简体   繁体   English

卸载后不删除nsis快捷方式

[英]nsis shortcuts not deleting after uninstall

I am using nsis to create windows installers for my application. 我正在使用nsis为我的应用程序创建Windows安装程序。 I've added shortcuts for the app and the uninstall.exe in startup menu and I delete them as part of uninstall, but the shortcuts are not deleted during uninstallation. 我已经在启动菜单中添加了该应用程序和uninstall.exe的快捷方式,并将它们作为卸载的一部分删除,但是这些快捷方式在卸载过程中不会被删除。 Snippet of the install and uninstall code is as below: 安装和卸载代码段如下:

section "install"
    createDirectory "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}\"
    createShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}\${APPNAME} Uninstall.lnk" "$INSTDIR\uninstall.exe"
    createShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}\${APPNAME}.lnk" "$INSTDIR\app.exe" "" "$INSTDIR\logo.ico" 
sectionEnd

section "uninstall"
    delete "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}\${APPNAME}.lnk"
    delete "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}\${APPNAME} Uninstall.lnk"
    rmDir /r "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}"    
sectionEnd

Can someone please help me with this. 有人可以帮我吗

Adding some details about which Windows version you are seeing this on etc. would help but I'm going to guess that this only happens on Vista and later . 添加一些有关您正在哪个Windows版本上看到的详细信息等,这将有所帮助,但是我猜测这只会在Vista及更高版本上发生 These versions of Windows have a compatibility shim that moves certain shortcuts to the all-users start menu. 这些版本的Windows具有兼容垫片,该垫片将某些快捷方式移至所有用户的开始菜单。

To stop Windows from doing this you must mark the installer as UAC compatible, this can be done by adding the RequestExecutionLevel attribute to your script. 要阻止Windows执行此操作,必须将安装程序标记为与UAC兼容,这可以通过将RequestExecutionLevel属性添加到脚本中来完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM