在安裝新版本之前,我強制卸載以前的版本。
出於某種原因,它不適用於XP/Vista/10 x64。卸載字符串爲空。我幾乎肯定它正在查找錯誤的註冊表。有沒有辦法強制它檢查非wow64(反之亦然)?我不知道它有什麼可能。NSIS在某些x64操作系統上未檢測到以前的版本
# The ExecWait seems not to work on Windows XP x64/Vista x64/10 x64 (it seems to work fine on Vista x64/8 x64)
${If} ${RunningX64}
${GetWindowsVersion} $R0
ReadRegStr $R1 HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "UninstallString"
MessageBox MB_OK "You are running $R0 x64! R1 is $R1"
StrCmp $R1 "" no_remove_uninstaller
${Else}
${GetWindowsVersion} $R0
ReadRegStr $R1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "UninstallString"
MessageBox MB_OK "You are running $R0 x86! R1 is $R1"
StrCmp $R1 "" no_remove_uninstaller
${EndIf}
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
"${PRODUCT_LONG_NAME} is already installed. $\n$\nIf you have software older than XXX 1.3, please manually uninstall it with Windows before proceeding. $\n$\nClick `OK` to remove the \
previous version or `Cancel` to cancel this upgrade." \
IDOK uninst IDCANCEL giveup
giveup:
Abort
# Run the uninstaller
uninst:
ExecWait '"$INSTDIR\uninst.exe" _?=$INSTDIR' $R1
StrCmp $R1 0 no_remove_uninstaller # Success? If so we are done...
Abort # Uninstaller was canceled or failed, we cannot continue
被修改 - I除去上面的64位的功能。並提出你所提到的改變。由於缺少InstallString,我使用filefunc getparent函數來執行測試。這應該做的伎倆,還是我需要仍然做regview?它似乎在XP x86和7 x64上工作,儘管他們一直工作。這使得奇怪的是,在兩個操作系統之間沒有。
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "UninstallString"
${GetParent} $0 $R0
IfFileExists "$R0\uninst.exe" 0 no_remove_uninstaller
ExecWait '"$R0\uninst.exe" _?=$R0' $R1
StrCmp 0 $R1 0 giveup
Delete "$R0\uninst.exe"
RMDir "$R0"
其他更新:它仍然無法在Vista x64和XP x64的工作。其他類型的Windows現在都可以使用。
最後更新我覺得現在的工作...我換從32
regview 64
,因爲我的我在做什麼逆轉思維。
你在64上安裝64位特定組件位版本的Windows?如果沒有,爲什麼你有64位特定的代碼呢? – Anders