From 796f26c0081c9660ce1ee121aed241ab4b2eda94 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 15 May 2014 11:54:34 -0700 Subject: [PATCH] Ask whether to check for updates in the installer Gets rid of the last annoying modal dialog on first startup. --- packages/win_installer/aegisub3.iss | 14 +++++++++++++- packages/win_installer/fragment_mainprogram.iss | 1 + packages/win_installer/fragment_strings.iss | 2 ++ packages/win_installer/fragment_strings.iss.in | 2 ++ po/aegisub.pot | 10 ++++++++++ 5 files changed, 28 insertions(+), 1 deletion(-) diff --git a/packages/win_installer/aegisub3.iss b/packages/win_installer/aegisub3.iss index 65e00a2f3..c9481406c 100644 --- a/packages/win_installer/aegisub3.iss +++ b/packages/win_installer/aegisub3.iss @@ -78,12 +78,24 @@ begin end; procedure CurStepChanged(CurStep: TSetupStep); +var + Updates: String; begin CurStepChangedMigration(CurStep); if CurStep = ssPostInstall then begin - SaveStringToFile(ExpandConstant('{app}\installer_config.json'), ExpandConstant('{{"App": {{"Language": "{language}"}}'), False); + if IsTaskSelected('checkforupdates') then + Updates := 'true' + else + Updates := 'false'; + + SaveStringToFile( + ExpandConstant('{app}\installer_config.json'), + FmtMessage('{"App": {"Auto": {"Check For Updates": %1}, "First Start": false, "Language": "%2"}}', [ + Updates, + ExpandConstant('{language}')]), + False); end; end; diff --git a/packages/win_installer/fragment_mainprogram.iss b/packages/win_installer/fragment_mainprogram.iss index 8f527fdb4..41ac0d036 100644 --- a/packages/win_installer/fragment_mainprogram.iss +++ b/packages/win_installer/fragment_mainprogram.iss @@ -35,6 +35,7 @@ [Tasks] Name: "startmenuicon"; Description: "{cm:StartMenuIcon}"; GroupDescription: "{cm:AdditionalIcons}" Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked +Name: "checkforupdates"; Description: "{cm:CheckForUpdates}"; GroupDescription: "{cm:UpdatesGroup}" [Files] ; main diff --git a/packages/win_installer/fragment_strings.iss b/packages/win_installer/fragment_strings.iss index e953e673b..042235622 100644 --- a/packages/win_installer/fragment_strings.iss +++ b/packages/win_installer/fragment_strings.iss @@ -1,6 +1,8 @@ [CustomMessages] InstallRuntime=Installing runtime libraries... StartMenuIcon=Create a start menu icon +CheckForUpdates=Automatically check for new versions of Aegisub +UpdatesGroup=Update Checker: ; Replacement for License page, no need to bother the user with legal mumbo-jumbo [Messages] diff --git a/packages/win_installer/fragment_strings.iss.in b/packages/win_installer/fragment_strings.iss.in index 5041bb850..fc87d3833 100644 --- a/packages/win_installer/fragment_strings.iss.in +++ b/packages/win_installer/fragment_strings.iss.in @@ -1,6 +1,8 @@ [CustomMessages] _InstallRuntime=Installing runtime libraries... _StartMenuIcon=Create a start menu icon +_CheckForUpdates=Automatically check for new versions of Aegisub +_UpdatesGroup=Update Checker: ; Replacement for License page, no need to bother the user with legal mumbo-jumbo [Messages] diff --git a/po/aegisub.pot b/po/aegisub.pot index 8695def1b..a15432926 100644 --- a/po/aegisub.pot +++ b/po/aegisub.pot @@ -6202,6 +6202,16 @@ msgid "Create a start menu icon" msgstr "" +#: packages/win_installer/fragment_strings.iss:1 +msgid "Automatically check for new versions of Aegisub" +msgstr "" + + +#: packages/win_installer/fragment_strings.iss:1 +msgid "Update Checker:" +msgstr "" + + #: packages/win_installer/fragment_strings.iss:1 msgid "This will install Aegisub {#BUILD_GIT_VERSION_STRING} on your computer.%n%nAegisub is covered by the GNU General Public License version 2. This means you may use the application for any purpose without charge, but that no warranties of any kind are given either.%n%nSee the Aegisub website for information on obtaining the source code." msgstr ""