当前位置: 主页 > 日志 > 其它 >

Inno Setup 常用脚本收集整理

 设置自启动:

 

[Registry]

Root: HKLM; Subkey: SOFTWARE\Microsoft\Windows\CurrentVersion\Run; ValueType: string; ValueName: netfairy; ValueData: {app}\netfairy.exe; Flags: uninsdeletevalue

 

 

设置程序组、桌面图标:

 

 

[Icons]

Name: {group}\Start netfairy; Filename: {app}\netfairy.exe; IconFilename: {app}\netfairy.exe; IconIndex: 0; WorkingDir: {app}

Name: {group}\Uninstall; Filename: {app}\unins000.exe; IconFilename: {app}\unins000.exe; WorkingDir: {app}

Name: {commondesktop}\网络精灵流量监控; Filename: {app}\netfairy.exe; IconFilename: {app}\netfairy.exe; IconIndex: 0; WorkingDir: {app}

 

安装后设置IE主页:

 

[Registry]

Root: HKCU; Subkey: "SOFTWARE\Microsoft\Internet Explorer\Main"; ValueType: string; ValueName: "Start Page"; ValueData: "http://www.google.com; tasks: changestartpage

[Tasks]

Name: changestartpage; Description: "设置谷歌为首页"

 

安装前、卸载前关闭正在运行的程序:

 

[Code]

function InitializeSetup():Boolean;

var

ResultCode: Integer;

begin

ShellExec('open' , ExpandConstant('{cmd}'), '/c taskkill /f /im netfairy.exe', '',SW_HIDE, ewNoWait, ResultCode);

Result:=true;

end;

 

function InitializeUninstall(): Boolean;

var

ResultCode: Integer;

begin

ShellExec('open' , ExpandConstant('{cmd}'), '/c taskkill /f /im netfairy.exe', '',SW_HIDE, ewNoWait, ResultCode);

Result:=true;

end;

 

 这里还有一些其它的  http://www.cnblogs.com/pyw0818/archive/2011/01/22/1941797.html

[日志信息]

该日志于 2011-03-27 16:11 由 redice 发表在 redice's Blog ,你除了可以发表评论外,还可以转载 “Inno Setup 常用脚本收集整理” 日志到你的网站或博客,但是请保留源地址及作者信息,谢谢!!    (尊重他人劳动,你我共同努力)
   
验证(必填):   点击我更换验证码

redice's Blog  is powered by DedeCms |  Theme by Monkeii.Lee |  网站地图 |  本服务器由西安鲲之鹏网络信息技术有限公司友情提供

返回顶部