Skip to content

Commit

Permalink
Sort out the installer
Browse files Browse the repository at this point in the history
  • Loading branch information
canton7 committed Feb 25, 2015
1 parent 8753f8e commit 651b131
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
29 changes: 17 additions & 12 deletions installer/installer.iss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define AppExeName "SyncTrayzor.exe"
#define AppRoot ".."
#define AppSrc AppRoot + "\src\SyncTrayzor"
#define AppBin AppRoot +"\bin\Release"
#define AppBin AppRoot +"\bin\x64\Release"
#define AppExe AppBin + "\SyncTrayzor.exe"
#define AppName GetStringFileInfo(AppExe, "ProductName")
#define AppVersion GetFileVersion(AppExe)
Expand All @@ -27,25 +27,29 @@ LicenseFile={#AppRoot}\LICENSE.txt
OutputDir="."
OutputBaseFilename={#AppName}Setup
SetupIconFile={#AppSrc}\Icons\default.ico
Compression=lzma
Compression=lzma2/max
SolidCompression=yes
PrivilegesRequired=admin
ArchitecturesInstallIn64BitMode=x64
ArchitecturesAllowed=x64

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "startonlogon"; Description: "Start SyncTrayzor automatically on logon"; GroupDescription: "Autostart"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Dirs]
Name: "{userappdata}\{#AppDataFolder}"

[Files]
Source: "{#AppBin}\{#AppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppBin}\*.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppBin}\{#AppExeName}.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppBin}\*.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppBin}\*.pdb"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppBin}\*.pak"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppBin}\*.dat"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppBin}\locales\*"; DestDir: "{app}\locales"; Flags: ignoreversion
Source: "{#AppSrc}\Icons\default.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppRoot}\*.md"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppRoot}\*.txt"; DestDir: "{app}"; Flags: ignoreversion
Expand All @@ -57,9 +61,6 @@ Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"
Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: desktopicon

[Registry]
Root: HKCU; Subkey: "{#RunRegKey}"; ValueType: string; ValueName: "SyncTrayzor"; ValueData: """{app}\{#AppExeName}"" -minimized"; Tasks: startonlogon

[Run]
Filename: "{tmp}\dotNet451Setup.exe"; Parameters: "/passive /promptrestart"; Check: FrameworkIsNotInstalled; StatusMsg: "Microsoft .NET Framework 4.5.1 is being installed. Please wait..."
Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
Expand All @@ -74,12 +75,16 @@ begin
result := not exists or (release < 378758);
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurUninstallStep = usPostUninstall then
begin
if RegValueExists(HKEY_CURRENT_USER, '{#RunRegKey}', 'SyncTrayzor') then
RegDeleteValue(HKEY_CURRENT_USER, '{#RunRegKey}', 'SyncTrayzor');
if CurStep = ssInstall then begin
{ Since we're shifting from 32-bit to 64-bit, clean up the 32-bit installation dir }
if DirExists(ExpandConstant('{pf32}\SyncTrayzor')) then
DelTree(ExpandConstant('{pf32}\SyncTrayzor'), True, True, True);
{ If we mistakenly wrote to the admin user's registry before, undo that now }
if RegValueExists(HKCU64, ExpandConstant('{#RunRegKey}'), 'SyncTrayzor') then
RegDeleteValue(HKCU64, ExpandConstant('{#RunRegKey}'), 'SyncTrayzor');
end;
end;
Expand Down
2 changes: 1 addition & 1 deletion src/SyncTrayzor/Services/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public Configuration(string syncThingPath, string syncThingApiKey)
this.CloseToTray = true;
this.ShowSynchronizedBalloon = true;
this.SyncthingAddress = "http://localhost:8384";
this.StartOnLogon = false;
this.StartOnLogon = true;
this.StartMinimized = true;
this.StartSyncthingAutomatically = true;
this.SyncthingApiKey = syncThingApiKey;
Expand Down

0 comments on commit 651b131

Please sign in to comment.