InstallShield卸载快捷方式的创建

方法如下:

prototype CreateUninstallShortcut(); //放在#include "ifx.h"后

//将该函数的代码加到安装脚本setup.rul

function CreateUninstallShortcut()  
 string strCmdLine; 
 LIST lstPath;
 begin  
 
 // For an InstallScript installation:
 strCmdLine = DISK1TARGET ^ "Setup.exe";   
 // For an InstallScript MSI installation:
 strCmdLine = UNINSTALL_STRING;   
 
 // The path has to be handled differently if you are running  
 // an InstallScript MSI installation on Windows 9X. 
 if ( SYSINFO.WIN9X.bWin9X ) then  
  lstPath = ListCreate( STRINGLIST ); 
 StrGetTokens( lstPath, UNINSTALL_STRING, "/" );   
 
 ListGetFirstString( lstPath, strCmdLine ); 
 LongPathToQuote( strCmdLine, TRUE ); 
 
 strCmdLine = strCmdLine + " /M" + PRODUCT_GUID;
endif;

 AddFolderIcon(FOLDER_PROGRAMS ^ szProjectName, "卸载",strCmdLine, "",TARGETDIR^"Uninstall.ico",0, "", REPLACE ); 
end;

最后只需在OnFirstUIBefore函数return之前调用下这个函数就可以了,但有实际使用中有两个方面需要注意:

1:szProjectName根据实际情况填写:如果你的程序安装后为“开始||程序||Simple||卸载”则需该为FOLDER_PROGRAMS ^ "Simple", 如果为“开始||程序||Simple||Simple||卸载”则改为FOLDER_PROGRAMS ^ "Simple//Simple"。

2:TARGETDIR^"Uninstall.ico"根据实际情况填写:即ICO文件所在的目录^ICO文件的名称。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值