Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Brendan Allan
8080b51a7f
bundle vc redistributables on windows 2026-02-17 15:55:26 +08:00
4 changed files with 30 additions and 2 deletions

Binary file not shown.

View file

@ -34,6 +34,7 @@
"active": true, "active": true,
"targets": ["deb", "rpm", "dmg", "nsis", "app"], "targets": ["deb", "rpm", "dmg", "nsis", "app"],
"externalBin": ["sidecars/opencode-cli"], "externalBin": ["sidecars/opencode-cli"],
"resources": ["resources/vc_redist.x64.exe"],
"linux": { "linux": {
"rpm": { "rpm": {
"compression": { "compression": {
@ -48,7 +49,8 @@
"nsis": { "nsis": {
"installerIcon": "icons/dev/icon.ico", "installerIcon": "icons/dev/icon.ico",
"headerImage": "assets/nsis-header.bmp", "headerImage": "assets/nsis-header.bmp",
"sidebarImage": "assets/nsis-sidebar.bmp" "sidebarImage": "assets/nsis-sidebar.bmp",
"installerHooks": "./windows/hooks.nsh"
} }
} }
}, },

View file

@ -11,9 +11,11 @@
"icons/prod/icon.icns", "icons/prod/icon.icns",
"icons/prod/icon.ico" "icons/prod/icon.ico"
], ],
"resources": ["resources/vc_redist.x64.exe"],
"windows": { "windows": {
"nsis": { "nsis": {
"installerIcon": "icons/prod/icon.ico" "installerIcon": "icons/prod/icon.ico",
"installerHooks": "./windows/hooks.nsh"
} }
}, },
"linux": { "linux": {

View file

@ -0,0 +1,24 @@
!include "FileFunc.nsh"
!macro NSIS_HOOK_POSTINSTALL
ReadRegDWord $0 HKLM "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64" "Installed"
${If} $0 == 1
DetailPrint "Visual C++ Redistributable already installed"
Goto vcredist_done
${EndIf}
${If} ${FileExists} "$INSTDIR\resources\vc_redist.x64.exe"
DetailPrint "Installing Visual C++ Redistributable..."
CopyFiles "$INSTDIR\resources\vc_redist.x64.exe" "$TEMP\vc_redist.x64.exe"
ExecWait '"$TEMP\vc_redist.x64.exe" /install /quiet /norestart' $0
${If} $0 == 0
DetailPrint "Visual C++ Redistributable installed successfully"
${Else}
MessageBox MB_ICONEXCLAMATION "Visual C++ installation failed. Some features may not work."
${EndIf}
Delete "$TEMP\vc_redist.x64.exe"
Delete "$INSTDIR\resources\vc_redist.x64.exe"
${EndIf}
vcredist_done:
!macroend