1)注册OCX或DLL: 添加文件后,点击右键选择文件属性-》高级,注册COM接口
2)写注册表:mscomm.reg的内容如下:
REGEDIT4
[HKEY_CLASSES_ROOT\Licenses\4250E830-6AC2-11cf-8ADB-00AA00C00905]
@="kjljvjjjoquqmjjjvpqqkqmqykypoqjquoun"
在【操作】-》【进行安装时】ON POST INSTALL 事件中:
--从 REG 文件导入mscomm.reg
Registry.SetValue(HKEY_CLASSES_ROOT,"Licenses\\4250E830-6AC2-11cf-8ADB-00AA00C00905","","kjljvjjjoquqmjjjvpqqkqmqykypoqjquoun",REG_SZ);
3)执行文件脚本:
在【操作】-》【进行安装时】ON POST INSTALL 事件中:
does_exist = Folder.DoesExist(_WindowsFolder.."\\Microsoft.NET\\Framework\\v1.1.4322");
if does_exist then
a=1;
else
File.Run(SessionVar.Expand("%AppFolder%").."\\Microsoft .NET Framework 1.1.exe", "", "", SW_MAXIMIZE, true);
end
error = Application.GetLastError();
-- If an error occurred, display an error message to the user.
if (error ~= 0) then
Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end
以上API函数,例如File.Run,常量,例如_WindowsFolder,等,见系统帮助文档