Update installer, now supports silent fresh install and automatically kills VRCX

This commit is contained in:
Natsumi
2023-05-24 01:31:41 +12:00
parent 7d7a71b74e
commit 1f4e8a4148
+4 -13
View File
@@ -81,18 +81,13 @@ Function .onInit
ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VRCX" "UninstallString" ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VRCX" "UninstallString"
StrCmp $R0 "" done StrCmp $R0 "" done
; wait for process to fully quit during upgrade ; If VRCX is already running, display a warning message
${If} ${Silent}
Sleep 2000
${EndIf}
; If VRCX is already running, display a warning message and exit
StrCpy $1 "VRCX.exe" StrCpy $1 "VRCX.exe"
nsProcess::_FindProcess "$1" nsProcess::_FindProcess "$1"
Pop $R1 Pop $R1
${If} $R1 = 0 ${If} $R1 = 0
MessageBox MB_OK|MB_ICONEXCLAMATION "VRCX is still running. Cannot install this software.$\nPlease close VRCX and try again." /SD IDOK MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "VRCX is still running. $\n$\nClick `OK` to kill the running process or `Cancel` to cancel this installer." /SD IDOK IDCANCEL cancel
Abort nsExec::ExecToStack "taskkill /IM VRCX.exe"
${EndIf} ${EndIf}
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "VRCX is already installed. $\n$\nClick `OK` to upgrade the existing installation or `Cancel` to cancel this upgrade." /SD IDOK IDCANCEL cancel MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "VRCX is already installed. $\n$\nClick `OK` to upgrade the existing installation or `Cancel` to cancel this upgrade." /SD IDOK IDCANCEL cancel
@@ -101,11 +96,7 @@ Function .onInit
Abort Abort
next: next:
StrCpy $upgradeInstallation "true" StrCpy $upgradeInstallation "true"
done: done:
${If} $upgradeInstallation == "false"
SetSilent normal
${EndIf}
FunctionEnd FunctionEnd
Function createDesktopShortcut Function createDesktopShortcut
@@ -132,7 +123,7 @@ Section "Install" SecInstall
afterupgrade: afterupgrade:
ReadRegStr $R0 HKCR "Installer\Dependencies\VC,redist.x64,amd64,14.34,bundle" "Version" ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\DevDiv\vc\Servicing\14.0\RuntimeMinimum" "Version"
IfErrors 0 VSRedistInstalled IfErrors 0 VSRedistInstalled
inetc::get "https://aka.ms/vs/17/release/vc_redist.x64.exe" $TEMP\vcredist_x64.exe inetc::get "https://aka.ms/vs/17/release/vc_redist.x64.exe" $TEMP\vcredist_x64.exe