From b1f74094f159e6a4317a3fb812a705bee7d045e1 Mon Sep 17 00:00:00 2001 From: deepend-tildeclub Date: Wed, 18 Mar 2026 21:22:07 -0600 Subject: [PATCH 1/4] Make VC++ redist installer option smarter --- win32/installer/zoitechat.iss.tt | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/win32/installer/zoitechat.iss.tt b/win32/installer/zoitechat.iss.tt index 4eb17de8..871f95d4 100644 --- a/win32/installer/zoitechat.iss.tt +++ b/win32/installer/zoitechat.iss.tt @@ -61,6 +61,8 @@ Name: "langs"; Description: "Language Interfaces"; Types: custom; Flags: disable Name: "langs\lua"; Description: "Lua"; Types: normal custom; Flags: disablenouninstallwarning Name: "langs\perl"; Description: "Perl (requires Perl 5.42)"; Types: custom; Flags: disablenouninstallwarning Name: "langs\python"; Description: "Python (requires Python 3.14.3)"; Types: custom; Flags: disablenouninstallwarning +Name: "deps"; Description: "Dependencies"; Types: custom; Flags: disablenouninstallwarning +Name: "deps\vcredist2015"; Description: "Visual C++ Redistributable 2015"; Types: normal minimal custom; Flags: disablenouninstallwarning [Tasks] Name: portable; Description: "Yes"; GroupDescription: "Portable Mode: Stores configuration files within install directory for portable drives."; Flags: unchecked @@ -81,7 +83,7 @@ Root: HKCR; Subkey: "ZoiteChat.Theme\shell\open\command"; ValueType: string; Val [Run] Filename: "{app}\zoitechat.exe"; Description: "Run ZoiteChat after closing the Wizard"; Flags: nowait postinstall skipifsilent Filename: "http://docs.zoitechat.org/en/latest/changelog.html"; Description: "See what's changed"; Flags: shellexec runasoriginaluser postinstall skipifsilent unchecked -Filename: "{tmp}\vcredist.exe"; Parameters: "/install /quiet /norestart"; StatusMsg: "Installing Visual C++ Redistributable"; Flags: skipifdoesntexist; Tasks: not portable +Filename: "{tmp}\vcredist.exe"; Parameters: "/install /quiet /norestart"; StatusMsg: "Installing Visual C++ Redistributable"; Components: deps\vcredist2015; Flags: skipifdoesntexist; Tasks: not portable Filename: "{tmp}\perl.msi"; StatusMsg: "Installing Perl"; Components: langs\perl; Flags: shellexec skipifdoesntexist; Tasks: not portable Filename: "{tmp}\python.msi"; StatusMsg: "Installing Python"; Components: langs\python; Flags: shellexec skipifdoesntexist; Tasks: not portable Filename: "{tmp}\python.exe"; Parameters: "InstallAllUsers=1 PrependPath=1"; StatusMsg: "Installing Python"; Components: langs\python; Flags: shellexec skipifdoesntexist; Tasks: not portable @@ -243,6 +245,22 @@ begin Result := FileExists(GetSysDir() + 'vcruntime140.dll');; end; +procedure UpdateVCRedistComponentState; +var + I: Integer; + Installed: Boolean; +begin + Installed := CheckVCInstall(); + for I := 0 to WizardForm.ComponentsList.Items.Count - 1 do + begin + if WizardForm.ComponentsList.ItemCaption[I] = 'Visual C++ Redistributable 2015' then + begin + WizardForm.ComponentsList.Checked[I] := not Installed; + WizardForm.ComponentsList.ItemEnabled[I] := not Installed; + end; + end; +end; + ///////////////////////////////////////////////////////////////////// function CheckSpellInstall(): Boolean; @@ -268,6 +286,9 @@ var PY3: String; SPELL: String; begin + if (CurPageID = wpSelectComponents) then + UpdateVCRedistComponentState(); + if(CurPageID = wpReady) then begin idpClearFiles; @@ -280,7 +301,7 @@ begin PY3 := 'https://www.python.org/ftp/python/3.14.3/python-3.14.3-amd64.exe'; SPELL := 'https://github.com/zoitechat/gvsbuild/releases/download/zoitechat-2.16.2/ZoiteChat.Spelling.Dictionaries.r2.exe'; - if not CheckVCInstall() then + if IsComponentSelected('deps\vcredist2015') and not CheckVCInstall() then idpAddFile(REDIST, ExpandConstant('{tmp}\vcredist.exe')); if IsComponentSelected('spell') and not CheckSpellInstall() then From 80c59795d7da87cc1c2c99bb4945826145fffb6e Mon Sep 17 00:00:00 2001 From: deepend-tildeclub Date: Wed, 18 Mar 2026 21:30:33 -0600 Subject: [PATCH 2/4] Use registry check for VC++ runtime detect --- win32/installer/zoitechat.iss.tt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/win32/installer/zoitechat.iss.tt b/win32/installer/zoitechat.iss.tt index 871f95d4..a07e4aec 100644 --- a/win32/installer/zoitechat.iss.tt +++ b/win32/installer/zoitechat.iss.tt @@ -241,8 +241,14 @@ end; ///////////////////////////////////////////////////////////////////// function CheckVCInstall(): Boolean; +var + Installed: Cardinal; begin - Result := FileExists(GetSysDir() + 'vcruntime140.dll');; + Result := False; + if RegQueryDWordValue(HKLM64, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Installed', Installed) then + Result := Installed = 1 + else if RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Installed', Installed) then + Result := Installed = 1; end; procedure UpdateVCRedistComponentState; From c8801dd5d3c96382a36f147a07ebc9ed514c4698 Mon Sep 17 00:00:00 2001 From: deepend-tildeclub Date: Wed, 18 Mar 2026 21:37:48 -0600 Subject: [PATCH 3/4] Add non-plugin installer download fallback --- win32/installer/zoitechat.iss.tt | 50 ++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/win32/installer/zoitechat.iss.tt b/win32/installer/zoitechat.iss.tt index a07e4aec..9fb5d9dc 100644 --- a/win32/installer/zoitechat.iss.tt +++ b/win32/installer/zoitechat.iss.tt @@ -198,6 +198,13 @@ BeveledLabel= {#APPNAM} [Code] #ifndef USE_INNO_DOWNLOAD_PLUGIN +var + FallbackDownloadUrls: array of String; + FallbackDownloadFiles: array of String; + +function URLDownloadToFile(Caller: Integer; URL: String; FileName: String; Reserved: Integer; StatusCB: Integer): Integer; +external 'URLDownloadToFileW@urlmon.dll stdcall delayload'; + // The Inno Download Plugin isn't always installed in CI environments. // Provide no-op fallback procedures so installer compilation still succeeds. procedure idpDownloadAfter(PageID: Integer); @@ -206,10 +213,40 @@ end; procedure idpClearFiles; begin + SetArrayLength(FallbackDownloadUrls, 0); + SetArrayLength(FallbackDownloadFiles, 0); end; procedure idpAddFile(URL: String; Filename: String); +var + I: Integer; begin + I := GetArrayLength(FallbackDownloadUrls); + SetArrayLength(FallbackDownloadUrls, I + 1); + SetArrayLength(FallbackDownloadFiles, I + 1); + FallbackDownloadUrls[I] := URL; + FallbackDownloadFiles[I] := Filename; +end; + +function idpDownloadQueuedFiles(): Boolean; +var + I: Integer; + ResultCode: Integer; +begin + Result := True; + for I := 0 to GetArrayLength(FallbackDownloadUrls) - 1 do + begin + if not FileExists(FallbackDownloadFiles[I]) then + begin + ResultCode := URLDownloadToFile(0, FallbackDownloadUrls[I], FallbackDownloadFiles[I], 0, 0); + if ResultCode <> 0 then + begin + MsgBox('Unable to download required installer dependency:' + #13#10 + FallbackDownloadUrls[I], mbError, MB_OK); + Result := False; + Exit; + end; + end; + end; end; #endif @@ -332,6 +369,17 @@ end; ///////////////////////////////////////////////////////////////////// function NextButtonClick(CurPageID: Integer): Boolean; begin + Result := True; + +#ifndef USE_INNO_DOWNLOAD_PLUGIN + if CurPageID = wpReady then + if not idpDownloadQueuedFiles() then + begin + Result := False; + Exit; + end; +#endif + if (CurPageID = wpSelectTasks) then if (WizardForm.TasksList.Checked[1] = True) then if (WizardDirValue() = ExpandConstant('{pf64}\ZoiteChat')) then @@ -339,8 +387,6 @@ begin WizardForm.TasksList.Checked[1] := False MsgBox('Portable mode is only intended for use on portable drives and has been disabled.', mbInformation, MB_OK) end; - - Result := True; // Always continue end; ///////////////////////////////////////////////////////////////////// From 725da0065b9195fa09a4edd0af59e787d722b60b Mon Sep 17 00:00:00 2001 From: deepend-tildeclub Date: Wed, 18 Mar 2026 21:43:13 -0600 Subject: [PATCH 4/4] installer: fixed vcredist download url. --- win32/installer/zoitechat.iss.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32/installer/zoitechat.iss.tt b/win32/installer/zoitechat.iss.tt index 9fb5d9dc..60abb52c 100644 --- a/win32/installer/zoitechat.iss.tt +++ b/win32/installer/zoitechat.iss.tt @@ -339,7 +339,7 @@ begin if not IsTaskSelected('portable') then begin - REDIST := 'https://github.com/zoitechat/gvsbuild/releases/download/zoitechat-2.16.2/vcredist_2015_x64.exe'; + REDIST := 'https://github.com/ZoiteChat/gvsbuild/releases/download/zoitechat-2.18.0-pre4/vc_redist.x64.exe'; PERL := 'https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_54201_64bit/strawberry-perl-5.42.0.1-64bit.msi'; PY3 := 'https://www.python.org/ftp/python/3.14.3/python-3.14.3-amd64.exe'; SPELL := 'https://github.com/zoitechat/gvsbuild/releases/download/zoitechat-2.16.2/ZoiteChat.Spelling.Dictionaries.r2.exe';