Skip to content

Commit

Permalink
fix: include vc_redist net installer in Windows and vulkan runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
thewh1teagle committed Sep 21, 2024
1 parent 2a6cfc4 commit 221e4bb
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 5 deletions.
16 changes: 11 additions & 5 deletions desktop/src-tauri/tauri.windows.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"bundle": {
"resources": {
"ffmpeg\\bin\\x64\\*": "./"
}
}
"bundle": {
"windows": {
"nsis": {
"installerHooks": "vc_redist.nsh"
}
},
"resources": {
"ffmpeg\\bin\\x64\\*": "./",
"vulkan_runtime\\x64\\*.dll": "./"
}
}
}
42 changes: 42 additions & 0 deletions desktop/src-tauri/vc_redist.nsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Section
; Check if the VC++ Redistributable is already installed
ReadRegStr $0 HKLM "SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x64" "Installed"

${If} $0 != ""
DetailPrint "vc_redist found! Skipping installation."
${Else}
; Define download URL and target path for vc_redist.x64.exe
StrCpy $0 "https://aka.ms/vs/17/release/vc_redist.x64.exe"
StrCpy $1 "$TEMP\vc_redist.x64.exe"

; Download the vc_redist.x64.exe installer
NSISdl::download $0 $1
Pop $0
${If} $0 == "success"
DetailPrint "vc_redist downloaded successfully"
${Else}
DetailPrint "vc_redist failed to download"
Call InstallFailed
Abort "vc_redist download failed, aborting installation"
${EndIf}

; Execute the downloaded installer
ExecWait '"$1" /install /passive /norestart' $0
${If} $0 == 0
DetailPrint "vc_redist installation completed successfully"
${Else}
DetailPrint "vc_redist installation failed"
Call InstallFailed
Abort "vc_redist installation failed, aborting process"
${EndIf}
${EndIf}
SectionEnd


Function InstallFailed
DetailPrint "vc_redist failed to download"
; Show a message box to inform the user
MessageBox MB_OK|MB_ICONEXCLAMATION "Failed to download VC++ Redistributable. Please download and install it manually. Click OK to open the URL to download."
; Open the URL in the default browser
ExecShell "open" "https://aka.ms/vs/17/release/vc_redist.x64.exe"
FunctionEnd

0 comments on commit 221e4bb

Please sign in to comment.