我把我的软件从Wix安装程序迁移到NSIS。在安装新版本的软件后,我首先需要卸载以前的Wix软件包(如果它存在的话)。
从NSIS安装程序,在“欢迎”屏幕上点击“下一步”,我正在检查以前的Wix软件包,如果它是现在卸载它。下面是我的代码片段:
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE RemovePrevVerFunction
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_LANGUAGE "English"
Function RemovePrevVerFunction
ReadRegStr $R0 HKLM "SOFTWARE\EMR\3.01.00" "InstallPath"
${If} $R0 != ""
MessageBox MB_OKCANCEL "EMR 3.01.00 is already installed. Remove the pervious version?" IDOK uninst
Abort
uninst:
ExecWait '"MsiExec.exe" /X{8ED262EE-FC73-47A9-BB86-D92223246881} /qn' ; /x is to uninstall and /qn is to uninstall it silently
${EndIf}
FunctionEnd
有了上面的代码,我可以卸载以前的版本。但我需要做更多的事。
请帮帮我。
发布于 2019-02-20 15:13:20
https://stackoverflow.com/questions/54782636
复制相似问题