NSIS不能删除其打包的程序桌面快捷方式的解决方式
2010-03-22 23:24
627 查看
实质上就是权限的问题,可以模仿如下方式处理
Windows Vista and Windows 7 automatically identifies installer executables,
including NSIS installers, and asks the user permission to run them with
elevated privileges. Automatic detection, however, comes with the price of
automatic backward compatibility tricks. One of which is automatic relocation of
shortcuts created in the Start Menu to All Users' Start Menu.
To workaround this, use the new RequestExecutionLevel command or create the
shortcuts in All Users' folders in the first place, using
SetShellVarContext.
Windows Vista and Windows 7 automatically identifies installer executables,
including NSIS installers, and asks the user permission to run them with
elevated privileges. Automatic detection, however, comes with the price of
automatic backward compatibility tricks. One of which is automatic relocation of
shortcuts created in the Start Menu to All Users' Start Menu.
To workaround this, use the new RequestExecutionLevel command or create the
shortcuts in All Users' folders in the first place, using
SetShellVarContext.
OutFile vista.exe Name Vista RequestExecutionLevel user Section CreateDirectory "$SMPROGRAMS/Vista Test" CreateShortcut "$SMPROGRAMS/Vista Test/hello.lnk" $WINDIR/notepad.exe WriteUninstaller $EXEDIR/uninst.exe SectionEnd Section uninstall Delete "$SMPROGRAMS/Vista Test/hello.lnk" RMDir "$SMPROGRAMS/Vista Test" SectionEnd
OutFile vista.exe Name Vista RequestExecutionLevel admin #NOTE: You still need to check user rights with UserInfo! Function .onInit #TODO: call UserInfo plugin to make sure user is admin FunctionEnd Section SetShellVarContext all CreateDirectory "$SMPROGRAMS/Vista Test" CreateShortcut "$SMPROGRAMS/Vista Test/hello.lnk" $WINDIR/notepad.exe WriteUninstaller $EXEDIR/uninst.exe SectionEnd Section uninstall SetShellVarContext all Delete "$SMPROGRAMS/Vista Test/hello.lnk" RMDir "$SMPROGRAMS/Vista Test" SectionEnd
原文链接:http://nsis.sourceforge.net/Shortcuts_removal_fails_on_Windows_Vista
相关文章推荐
- android程序卸载后无法删除桌面快捷方式的解决办法
- android程序卸载后无法删除桌面快捷方式的解决办法
- android程序卸载后无法删除桌面快捷方式的解决办法
- android程序卸载后无法删除桌面快捷方式的解决办法
- cxfreeze打包python程序的方法说明(生成安装包,实现桌面快捷方式、删除快捷方式)
- win7下桌面IE快捷方式无法删除解决方法
- Android 程序桌面快捷方式的检测、添加和删除相关网址
- (2356)使用NSIS打包的应用程序,在Vista中无法正确删除开始菜单快捷方式的问题解决方案
- 创建和删除程序桌面快捷方式
- 【转】[win7] 桌面IE快捷方式无法删除 解决办法
- 用VB6自带打包工具创建桌面快捷方式和卸载程序
- vs打包程序步骤 开始程序和卸载以及桌面快捷方式
- 使用 NSIS打包的应用程序,在Vista中无法正确删除开始菜单快捷方式的问题解决方案
- windows7不能将程序快捷方式附加到任务栏,没有"将此程序锁定到任务栏"项的解决办法
- NSIS 打包 win7 中无法删除快捷方式
- 解决win7自动删除桌面无效的快捷方式
- C# 打包后,快捷方式属性下不能出现“查找目标” 解决
- Android 创建和删除程序桌面快捷方式(转)
- android程序桌面快捷方式的检测添加和删除
- windows7不能将程序快捷方式附加到任务栏的解决办法