Setup Factory 7.0获取安装包名称、读取.ini文件名、注册ActiveX组件、创建快捷方式、HTTP请求

1、获取安装包名称:

fullName = SessionVar.Get("%SourceFilename%");
result = String.SplitPath(fullName)

此时result将会有四个字段:

Drive

string

The drive portion of the path (for example, C:).

Folder

string

All of the folders within the path (for example, \MyFolder1\MyFolder2\).

Filename

string

The filename in the path (for example, "myfile").

Extension

string

The file extension in the path (for example, ".exe").

result.Filename就是安装包的名字

2、读取.ini文件

result = INIFile.GetValue(SessionVar.Expand("%SourceFolder%\\set.ini"), "set", "url");//读取安装包的配置文件set.ini
INIFile.SetValue(SessionVar.Expand("%AppFolder%\\config.ini"), "set", "url", result);//设置启动程序的配置文件config.ini信息

3、注册ActiveX组件

Shell.Execute("regsvr32", "open",  SessionVar.Expand(" /s %AppData%\\%ProductName%\\OverDelayIcon.dll"), "", SW_SHOWNORMAL)

4、创建快捷方式

Shell.CreateShortcut(SessionVar.Expand("%AppData%\\%ProductName%"), "Uninstall", SessionVar.Expand("%AppFolder%\\uninstall.exe"), SessionVar.Expand("\"/U:%AppFolder%\\uninstall.xml\""), "", "", 0, SW_SHOWNORMAL, nil, "");

如果通过程序创建快捷方式,在卸载时也需要通过程序进行删除


5、http请求

HTTP.Submit(URL, myTable, SUBMITWEB_GET, 5, 80, nil, nil);

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值