mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-19 06:30:10 +08:00
Merge branch 'CherryHQ:main' into New1207
This commit is contained in:
commit
1fee2d443a
@ -12,8 +12,13 @@
|
|||||||
|
|
||||||
; https://github.com/electron-userland/electron-builder/issues/1122
|
; https://github.com/electron-userland/electron-builder/issues/1122
|
||||||
!ifndef BUILD_UNINSTALLER
|
!ifndef BUILD_UNINSTALLER
|
||||||
|
; Check VC++ Redistributable based on architecture stored in $1
|
||||||
Function checkVCRedist
|
Function checkVCRedist
|
||||||
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64" "Installed"
|
${If} $1 == "arm64"
|
||||||
|
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\ARM64" "Installed"
|
||||||
|
${Else}
|
||||||
|
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64" "Installed"
|
||||||
|
${EndIf}
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function checkArchitectureCompatibility
|
Function checkArchitectureCompatibility
|
||||||
@ -97,29 +102,47 @@
|
|||||||
|
|
||||||
Call checkVCRedist
|
Call checkVCRedist
|
||||||
${If} $0 != "1"
|
${If} $0 != "1"
|
||||||
MessageBox MB_YESNO "\
|
; VC++ is required - install automatically since declining would abort anyway
|
||||||
NOTE: ${PRODUCT_NAME} requires $\r$\n\
|
; Select download URL based on system architecture (stored in $1)
|
||||||
'Microsoft Visual C++ Redistributable'$\r$\n\
|
${If} $1 == "arm64"
|
||||||
to function properly.$\r$\n$\r$\n\
|
StrCpy $2 "https://aka.ms/vs/17/release/vc_redist.arm64.exe"
|
||||||
Download and install now?" /SD IDYES IDYES InstallVCRedist IDNO DontInstall
|
StrCpy $3 "$TEMP\vc_redist.arm64.exe"
|
||||||
InstallVCRedist:
|
${Else}
|
||||||
inetc::get /CAPTION " " /BANNER "Downloading Microsoft Visual C++ Redistributable..." "https://aka.ms/vs/17/release/vc_redist.x64.exe" "$TEMP\vc_redist.x64.exe"
|
StrCpy $2 "https://aka.ms/vs/17/release/vc_redist.x64.exe"
|
||||||
ExecWait "$TEMP\vc_redist.x64.exe /install /norestart"
|
StrCpy $3 "$TEMP\vc_redist.x64.exe"
|
||||||
;IfErrors InstallError ContinueInstall ; vc_redist exit code is unreliable :(
|
${EndIf}
|
||||||
Call checkVCRedist
|
|
||||||
${If} $0 == "1"
|
|
||||||
Goto ContinueInstall
|
|
||||||
${EndIf}
|
|
||||||
|
|
||||||
;InstallError:
|
inetc::get /CAPTION " " /BANNER "Downloading Microsoft Visual C++ Redistributable..." \
|
||||||
MessageBox MB_ICONSTOP "\
|
$2 $3 /END
|
||||||
There was an unexpected error installing$\r$\n\
|
Pop $0 ; Get download status from inetc::get
|
||||||
Microsoft Visual C++ Redistributable.$\r$\n\
|
${If} $0 != "OK"
|
||||||
The installation of ${PRODUCT_NAME} cannot continue."
|
MessageBox MB_ICONSTOP|MB_YESNO "\
|
||||||
DontInstall:
|
Failed to download Microsoft Visual C++ Redistributable.$\r$\n$\r$\n\
|
||||||
|
Error: $0$\r$\n$\r$\n\
|
||||||
|
Would you like to open the download page in your browser?$\r$\n\
|
||||||
|
$2" IDYES openDownloadUrl IDNO skipDownloadUrl
|
||||||
|
openDownloadUrl:
|
||||||
|
ExecShell "open" $2
|
||||||
|
skipDownloadUrl:
|
||||||
Abort
|
Abort
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
|
ExecWait "$3 /install /quiet /norestart"
|
||||||
|
; Note: vc_redist exit code is unreliable, verify via registry check instead
|
||||||
|
|
||||||
|
Call checkVCRedist
|
||||||
|
${If} $0 != "1"
|
||||||
|
MessageBox MB_ICONSTOP|MB_YESNO "\
|
||||||
|
Microsoft Visual C++ Redistributable installation failed.$\r$\n$\r$\n\
|
||||||
|
Would you like to open the download page in your browser?$\r$\n\
|
||||||
|
$2$\r$\n$\r$\n\
|
||||||
|
The installation of ${PRODUCT_NAME} cannot continue." IDYES openInstallUrl IDNO skipInstallUrl
|
||||||
|
openInstallUrl:
|
||||||
|
ExecShell "open" $2
|
||||||
|
skipInstallUrl:
|
||||||
|
Abort
|
||||||
|
${EndIf}
|
||||||
${EndIf}
|
${EndIf}
|
||||||
ContinueInstall:
|
|
||||||
Pop $4
|
Pop $4
|
||||||
Pop $3
|
Pop $3
|
||||||
Pop $2
|
Pop $2
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user