Skip to content

Commit

Permalink
Fix issue with restarting application after Update
Browse files Browse the repository at this point in the history
Fixes #495
  • Loading branch information
Belphemur committed Aug 22, 2020
1 parent 9850be5 commit 3df6f9b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Installer/setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ SignTool=Certum
SignedUninstaller=yes
LicenseFile={#ExeDir}\LICENSE.txt
SetupLogging=yes
RestartApplications=no
;AppMutex={#MyAppSetupName}

;MinVersion default value: "0,5.0 (Windows 2000+) if Unicode Inno Setup, else 4.0,4.0 (Windows 95+)"
Expand Down Expand Up @@ -105,9 +106,9 @@ Name: "{group}\{cm:UninstallProgram,{#MyAppSetupName}}"; Filename: "{uninstallex
Name: "{userdesktop}\{#MyAppSetupName}"; Filename: "{app}\SoundSwitch.exe"; Tasks: desktopicon; AppUserModelID: aaflalo.{#MyAppSetupName}.Application

[Run]
Filename: "{app}\SoundSwitch.exe"; Description: "{cm:LaunchProgram,{#MyAppSetupName}}"; Flags: nowait postinstall
Filename: "{app}\SoundSwitch.exe"; Description: "{cm:LaunchProgram,{#MyAppSetupName}}"; Flags: nowait postinstall;
Filename: "{app}\Readme.html"; Description: "{cm:ViewReadmeFile}"; Flags: postinstall shellexec skipifsilent
Filename: "https://soundswitch.aaflalo.me/?utm_source={#MyAppVersion}&utm_campaign=installer#donate"; Description: "{cm:SupportTheProject}"; Flags: postinstall shellexec skipifsilent runasoriginaluser
Filename: "https://soundswitch.aaflalo.me/?utm_source={#MyAppVersion}&utm_campaign=installer#donate"; Description: "{cm:SupportTheProject}"; Flags: postinstall shellexec runasoriginaluser
Filename: "{app}\Changelog.html"; Description: "{cm:ViewChangelogFile}"; Flags: postinstall shellexec skipifsilent unchecked

[CustomMessages]
Expand Down
2 changes: 1 addition & 1 deletion SoundSwitch/Model/SoundSwitchApplicationContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public SoundSwitchApplicationContext()
{
if (@event.UpdateMode == UpdateMode.Silent)
{
new AutoUpdater("/VERYSILENT /NOCANCEL /NORESTART", ApplicationPath.Default).Update(
new AutoUpdater("/VERYSILENT /NOCANCEL /NORESTART /CLOSEAPPLICATIONS", ApplicationPath.Default).Update(
@event.Release, true);
}
};
Expand Down
2 changes: 1 addition & 1 deletion SoundSwitch/UI/Forms/UpdateDownloadForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private void cancelButton_Click(object sender, EventArgs e)

private void installButton_Click(object sender, EventArgs e)
{
new WebFileRunner(ApplicationPath.InstallDirectory).RunFile(_releaseFile);
new WebFileRunner(ApplicationPath.InstallDirectory).RunFile(_releaseFile, "/VERYSILENT /NOCANCEL /NORESTART /CLOSEAPPLICATIONS");
Close();
}

Expand Down

0 comments on commit 3df6f9b

Please sign in to comment.