diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f148868..97efcfe 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -255,6 +255,20 @@ jobs: Write-Host "Resolved CUDA_PATH = $cudaPath" Pop-Location + - name: Download INetC plugin + shell: powershell + run: | + $url = "https://github.com/DigitalMediaServer/NSIS-INetC-plugin/releases/download/v1.0.5.7/InetC.zip" + $out = "$env:RUNNER_TEMP\InetC.zip" + Invoke-WebRequest -Uri $url -OutFile $out + Expand-Archive $out -DestinationPath "$env:RUNNER_TEMP\InetC" -Force + + $source = "$env:RUNNER_TEMP\InetC\x86-unicode\INetC.dll" + $target = "C:\Program Files (x86)\NSIS\Plugins\x86-unicode\INetC.dll" + + Write-Host "Copying $source to $target" + Copy-Item $source $target -Force + - name: Checkout code uses: actions/checkout@v4 diff --git a/scripts/windows/nsis_script.nsi b/scripts/windows/nsis_script.nsi index 0a57b97..c7d3751 100644 --- a/scripts/windows/nsis_script.nsi +++ b/scripts/windows/nsis_script.nsi @@ -44,6 +44,27 @@ InstallDir "$PROGRAMFILES\CrossDesk" InstallDirRegKey HKCU "Software\${PRODUCT_NAME}" "InstallDir" ShowInstDetails show +Function CheckVCRedist + ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64" "Installed" + StrCmp $0 1 done + + DetailPrint "Downloading Microsoft Visual C++ Redistributable..." + inetc::get /popup "" /caption "Downloading VC++ Runtime..." \ + "https://aka.ms/vs/17/release/vc_redist.x64.exe" \ + "$TEMP\\vc_redist.x64.exe" + Pop $0 + StrCmp $0 "OK" +2 + MessageBox MB_OK "Failed to download VC++ Redistributable. Please install it manually." IDOK done + + ExecWait '"$TEMP\\vc_redist.x64.exe" /quiet /norestart' + +done: +FunctionEnd + +Section "VC++ Runtime" + Call CheckVCRedist +SectionEnd + Section "MainSection" SetOutPath "$INSTDIR" SetOverwrite ifnewer @@ -109,9 +130,6 @@ Section "Uninstall" RMDir /r "$LOCALAPPDATA\CrossDesk" SectionEnd -Section -Post -SectionEnd - ; ------ Functions ------ Function LaunchApp Exec "$INSTDIR\crossdesk.exe"