-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switched installer to Inno Setup. 64 bit install now uses correct folder. Application is now signed.
- Loading branch information
Phil
committed
Apr 26, 2016
1 parent
1110912
commit 3ab32d0
Showing
5 changed files
with
584 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
; Script generated by the Inno Script Studio Wizard. | ||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! | ||
|
||
#define MyAppName "WOLAgent" | ||
#define MyAppPublisher "Aquila Technology" | ||
#define MyAppURL "http://wol.aquilatech.com/" | ||
#define rootFolder "C:\Projects\agent" | ||
#define MyAppExeName "WOLAgent.exe" | ||
#define MyDescription "Aquila WOL Agent" | ||
#define MyAppVersion GetFileVersion("C:\Projects\Agent\bin\Release\WOLAgent.exe") | ||
|
||
#define signtool "c:\Program Files (x86)\Windows Kits\10\bin\x64\signtool.exe" | ||
#define subject "Open Source Developer, Phillip Tull" | ||
|
||
[Setup] | ||
; NOTE: The value of AppId uniquely identifies this application. | ||
; Do not use the same AppId value in installers for other applications. | ||
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) | ||
AppId={{E0E4F4B0-2D93-4E03-B540-9198094045C4} | ||
AppName={#MyAppName} | ||
AppVersion={#MyAppVersion} | ||
;AppVerName={#MyAppName} {#MyAppVersion} | ||
AppPublisher={#MyAppPublisher} | ||
AppPublisherURL={#MyAppURL} | ||
AppSupportURL={#MyAppURL} | ||
AppUpdatesURL={#MyAppURL} | ||
DefaultDirName={pf}\{#MyAppName} | ||
DefaultGroupName=WOLAgent | ||
OutputDir=Release | ||
OutputBaseFilename={#MyAppName}_{#MyAppVersion} | ||
Compression=lzma | ||
SolidCompression=yes | ||
ArchitecturesInstallIn64BitMode=x64 ia64 | ||
|
||
; declare mysign=$p | ||
SignTool=mysign {#signtool} sign /a /n $q{#subject}$q /fd sha1 /t http://timestamp.comodoca.com/authenticode /d $q{#MyAppName}$q $f | ||
SignTool=mysign {#signtool} sign /a /n $q{#subject}$q /as /fd sha256 /td sha256 /tr http://timestamp.comodoca.com/rfc3161 /d $q{#MyAppName}$q $f | ||
|
||
[Languages] | ||
Name: "english"; MessagesFile: "compiler:Default.isl" | ||
|
||
[Files] | ||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files | ||
Source: "{#rootFolder}\bin\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; BeforeInstall: BeforeServiceInstall('{#MyAppName}', '{#MyAppExeName}'); AfterInstall: AfterServiceInstall('{#MyAppName}', '{#MyAppExeName}') | ||
|
||
[Registry] | ||
Root: "HKLM"; Subkey: "SYSTEM\CurrentControlSet\Services\{#MyAppName}"; ValueType: string; ValueName: "Description"; ValueData: "Passes WOL packets between networks."; Flags: createvalueifdoesntexist deletevalue | ||
|
||
[Code] | ||
#include "services_unicode.iss" | ||
procedure BeforeServiceInstall(SvcName, FileName: String); | ||
var | ||
S: Longword; | ||
begin | ||
//If service is installed, it needs to be stopped | ||
if ServiceExists(SvcName) then begin | ||
S:= SimpleQueryService(SvcName); | ||
if S <> SERVICE_STOPPED then begin | ||
SimpleStopService(SvcName, True, True); | ||
end; | ||
end; | ||
end; | ||
procedure AfterServiceInstall(SvcName, FileName: String); | ||
begin | ||
//If service is not installed, it needs to be installed now | ||
if not ServiceExists(SvcName) then begin | ||
if SimpleCreateService(SvcName, '{#MyDescription}', ExpandConstant('{app}')+'\' + FileName, SERVICE_AUTO_START, '', '', False, True) then begin | ||
//Service successfully installed | ||
SimpleStartService(SvcName, True, True); | ||
end else begin | ||
//Service failed to install | ||
end; | ||
end; | ||
end; | ||
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); | ||
var | ||
mRes : integer; | ||
S: Longword; | ||
SvcName : String; | ||
begin | ||
SvcName := '{#MyAppName}'; | ||
case CurUninstallStep of | ||
usUninstall: | ||
begin | ||
mRes := MsgBox('Do you want to remove the {#MyAppName} service?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2) | ||
if mRes = IDYES then | ||
begin | ||
//If service is installed, it needs to be stopped | ||
if ServiceExists(SvcName) then begin | ||
S:= SimpleQueryService(SvcName); | ||
if S <> SERVICE_STOPPED then begin | ||
SimpleStopService(SvcName, True, True); | ||
end; | ||
SimpleDeleteService(SvcName); | ||
end; | ||
end; | ||
end; | ||
end; | ||
end; |
Oops, something went wrong.