Skip to content

Commit 054d138

Browse files
committed
updatetool (#10)
1 parent 4568788 commit 054d138

19 files changed

+991
-56
lines changed

AutoUpdater.vs160.sln

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SignTool", "msvc\SignTool.v
3030
{EBA010B5-F14F-4AED-9E6B-D519BACD1615} = {EBA010B5-F14F-4AED-9E6B-D519BACD1615}
3131
EndProjectSection
3232
EndProject
33+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UpdateTool", "msvc\UpdateTool.vs160.vcxproj", "{A1BE9C67-1B56-41BC-A518-76C03C53FC42}"
34+
ProjectSection(ProjectDependencies) = postProject
35+
{EBA010B5-F14F-4AED-9E6B-D519BACD1615} = {EBA010B5-F14F-4AED-9E6B-D519BACD1615}
36+
EndProjectSection
37+
EndProject
3338
Global
3439
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3540
Debug|Win32 = Debug|Win32
@@ -86,6 +91,14 @@ Global
8691
{A1BE9C67-1B56-41BC-A518-76C03C53FCF2}.Release|Win32.Build.0 = Release|Win32
8792
{A1BE9C67-1B56-41BC-A518-76C03C53FCF2}.Release|x64.ActiveCfg = Release|x64
8893
{A1BE9C67-1B56-41BC-A518-76C03C53FCF2}.Release|x64.Build.0 = Release|x64
94+
{A1BE9C67-1B56-41BC-A518-76C03C53FC42}.Debug|Win32.ActiveCfg = Debug|Win32
95+
{A1BE9C67-1B56-41BC-A518-76C03C53FC42}.Debug|Win32.Build.0 = Debug|Win32
96+
{A1BE9C67-1B56-41BC-A518-76C03C53FC42}.Debug|x64.ActiveCfg = Debug|x64
97+
{A1BE9C67-1B56-41BC-A518-76C03C53FC42}.Debug|x64.Build.0 = Debug|x64
98+
{A1BE9C67-1B56-41BC-A518-76C03C53FC42}.Release|Win32.ActiveCfg = Release|Win32
99+
{A1BE9C67-1B56-41BC-A518-76C03C53FC42}.Release|Win32.Build.0 = Release|Win32
100+
{A1BE9C67-1B56-41BC-A518-76C03C53FC42}.Release|x64.ActiveCfg = Release|x64
101+
{A1BE9C67-1B56-41BC-A518-76C03C53FC42}.Release|x64.Build.0 = Release|x64
89102
EndGlobalSection
90103
GlobalSection(SolutionProperties) = preSolution
91104
HideSolutionNode = FALSE

README.md

Lines changed: 84 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ signtool -K application_private.pem -x 1 -v 0.0.1 \
5858
The resulting signature block is exported that can then by cut & pasted into the application manifest,
5959
which you can value add to include a change notice related to the installer release.
6060

61-
```
61+
```xml
6262
<title></title>
6363
<link></link>
6464
<description></description>
@@ -76,9 +76,31 @@ which you can value add to include a change notice related to the installer rele
7676
type="application/octet-stream" />
7777
```
7878

79-
Example application.manifest.
79+
### sign application integration
80+
81+
To simplifying application integration a customised version of _signtool_ can be built.
82+
Using the provided application shim, default arguments can be provided stream-lining software management.
83+
84+
```C++
85+
//
86+
// signtool specialisation
87+
//
88+
#include "libappupdater/sign/signtoolshim.h" // SignToolShim()
8089

90+
int
91+
main(int argc, char *argv[])
92+
{
93+
struct SignToolArgs args = {0};
94+
95+
args.hosturl = "https://github.com/user/repo~application.manifest";
96+
97+
return SignToolShim(argc, argv, &args);
98+
}
8199
```
100+
101+
## Example application.manifest
102+
103+
```xml
82104
<?xml version="1.0" encoding="utf-8"?>
83105
<manifest>
84106
<channel name="release">
@@ -127,6 +149,66 @@ ul.b { list-style-type: square; padding: 0px; margin: 0px; }
127149
</manifest>
128150
```
129151

152+
### Updater application integration
153+
154+
Application integration can be achieved using several methods.
155+
156+
- As a stand-alone updater application; or
157+
- embedded within the target application.
158+
159+
Working examples are provided as test applications. For following demonstrates one method
160+
161+
#### Standalone integration:
162+
163+
```C++
164+
#include "libappupdater/update/updatetoolshim.h" // UpdaterToolShim()
165+
166+
#include "version.h" // VERSION_TAG, build-system version.
167+
#include "private_key.h" // PUBLIC_KEY and KEY_VERSION, see: keygen
168+
169+
int
170+
main(int argc, char *argv[])
171+
{
172+
struct UpdateToolArgs args = {0};
173+
174+
args.title = "MyApplication updater";
175+
args.version = VERSION_TAG;
176+
args.hosturl = "https://github.com/user/repo~application.manifest";
177+
args.publickey = PUBLIC_KEY;
178+
args.keyversion = KEY_VERSION;
179+
180+
return UpdateToolShim(argc, argv, &args);
181+
}
182+
```
183+
184+
#### Embedded integration:
185+
186+
```C++
187+
#include "libappupdater/src/AutoUpdater.h" // AutoUpdater
188+
189+
#include "version.h" // VERSION_TAG, build-system version.
190+
#include "private_key.h" // PUBLIC_KEY and KEY_VERSION, see: keygen
191+
192+
int
193+
Application::CheckForUpdates()
194+
{
195+
AutoUpdater au;
196+
197+
// Note parameters stated either by:
198+
// o Explicit run-time arguments; or
199+
// o Application resource elements, alone-side VERSIONINFO information;
200+
// see AutoConfig.h for further details.
201+
//
202+
au.EnableDialog();
203+
au.AppName("Application Name");
204+
au.AppVersion(VERSION_TAG);
205+
au.HostURL("https://github.com/user/repo~application.manifest");
206+
au.PublicKey(PUBLIC_KEY, KEY_VERSION);
207+
208+
au.Execute(AutoUpdater::ExecuteAuto, true);
209+
}
210+
```
211+
130212
## License
131213

132214
MIT License
@@ -151,4 +233,3 @@ ul.b { list-style-type: square; padding: 0px; margin: 0px; }
151233
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
152234
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
153235
SOFTWARE.
154-

msvc/SignTool.vs160.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<PropertyGroup Label="Globals">
2222
<ProjectName>SignTool</ProjectName>
2323
<ProjectGuid>{A1BE9C67-1B56-41BC-A518-76C03C53FCF2}</ProjectGuid>
24-
<RootNamespace>KeyGen</RootNamespace>
24+
<RootNamespace>SignTool</RootNamespace>
2525
<Keyword>MFCProj</Keyword>
2626
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
2727
</PropertyGroup>
@@ -252,4 +252,4 @@
252252
<UserProperties RESOURCE_FILE=".\..\src\TAutoUpdater.rc" />
253253
</VisualStudio>
254254
</ProjectExtensions>
255-
</Project>
255+
</Project>

0 commit comments

Comments
 (0)