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);