安装程序制作

installshield的使用


下载地址:

http://download.csdn.net/download/yinxing408033943/4263508

软件安装工具 InstallShield.2010.Premier.v16


要求

1.安装时添加环境变量

2.卸载时删除注册表的相关信息


待补充...


资料一、

HOWTO:安装包卸载时如何删除安装时写在系统环境变量中的内容 作者万炳宏 - Kevin Wan

http://www.cnblogs.com/installshield/archive/2011/01/24/1943406.html
2011-01-24 17:52 by Kevin.Wan, 1429 阅读, 2 评论, 收藏编辑

在用InstallShield制作安装包时,有时我们会在脚本中通过操作注册表,配置系统环境变量,比如在Path中追加,但卸载时如何清除追加的路径变量,一直有些模糊。

 

今天受网友启发,在InstallShield的帮助文档中找到了解决办法,代码如下:

复制代码
function   OnBegin ()  
    
STRING  svSearchPath;
begin
     //   Set  up the search path  to  pass  as  a parameter  to  PathSet. 
    svSearchPath 
=   " C:\\DOS;C:\\WINDOWS;C:\\TEMP; "   +  
                   
" D:\\Program Files\\Kevin Wan\\InstallShield; "   +  
                   
" C:\\EXAMPLE\\SOURCE;D:\\WORK\\TEMP "

     //  Initialize the path buffer. 
    
PathSet  (svSearchPath); 

     //  Display the initial search path. 
     //  Delete  D:\Program Files\Kevin Wan\InstallShield fro m the path buffer.                            

    if (PathDelete ("Kevin Wan"PARTIAL<0then    

        MessageBox ("First call to PathDelete failed.", SEVERE); 
    endif

    // Get the search path from the path buffer; this call also releases 
    
// the memory allocated for the path buffer. 

    PathGet (svSearchPath); 
    
MessageBox(svSearchPath, INFORMATION);
end;

这里我将Sample添加到了事件响应函数OnBegin中,大家实际操作时可以写到OnUninstall中。

Sample中我删除了和Kevin Wan相关的路径,但也要注意,这里最好选择唯一标示的字符串,否则可能会把其他程序写入的路径变量也同时删除了。


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值