1
我',需要檢查它是否已經安裝:Installer未利用NSIS創建安裝程序爲我的應用程序檢測到舊版本安裝NSIS
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "MyAppInstaller.exe"
InstallDir "$PROGRAMFILES\MyApp"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show
Function .onInit
; Check to see if already installed
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME} ${PRODUCT_VERSION}" "UninstallString"
IfFileExists $R0 +1 NotInstalled
Messagebox MB_ICONQUESTION|MB_YESNO "MyApp 1.0 is already installed.Do you want to uninstall old version" IDNO Quit
Exec $R0
Quit:
Quit
NotInstalled:
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd ...
卻沒有任何反應總是進行安裝和沒」檢測舊的安裝版本,我錯過了什麼?我不太瞭解NSIS腳本,所以任何幫助將不勝感激。
是,正確的是'$ ReadRegStr R0 HKLM「Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ $ {PRODUCT_NAME}」「UninstallString」'thnak你的時間。 – Oumaya