用inno setup制作安装程序
来源:互联网 发布:哪些属于大数据项目 编辑:程序博客网 时间:2024/05/16 13:02
用inno setup 5.5.5汉化版制作“我的应用”
代码如下:
补丁日志:
20150724:
1).修复:在卸载面板中,显示卸载图标.(2015-07-21下载地址的代码上是bug,请留意)
解决方法:
[Setup]
UninstallDisplayIcon={app}\install.ico
[Files]
Source: “install.ico”; DestDir: “{app}”; Flags: ignoreversion
2).修复:unins000.exe 显示乱码
解决方法:安装inno setup 5.5.5时,选择unicode格式进行安装
; 脚本由 Inno Setup 脚本向导 生成!; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档!#define MyAppName "我的应用"#define MyAppVersion "1.1.2"#define MyAppPublisher "google公司"#define MyAppURL "http://www.google.com/"#define MyAppExeName "gloudarena.exe"[Setup]; 注: AppId的值为单独标识该应用程序。; 不要为其他安装程序使用相同的AppId值。; (生成新的GUID,点击 工具|在IDE中生成GUID。)AppId={{B82CFEB7-9B37-4CCE-A253-580F33E982F0}AppName={#MyAppName}AppVersion={#MyAppVersion};AppVerName={#MyAppName} {#MyAppVersion}AppPublisher={#MyAppPublisher}AppPublisherURL={#MyAppURL}AppSupportURL={#MyAppURL}AppUpdatesURL={#MyAppURL}DefaultDirName={pf}/Gloud/ArenaDefaultGroupName={#MyAppName}DisableProgramGroupPage=yesLicenseFile=C:\Users\MyPC\Desktop\gameSetup\cn.gloud.arena-20150706-gloud\README.txtOutputBaseFilename=我的应用SetupIconFile=C:\Users\MyPC\Desktop\gameSetup\install.icoCompression=lzmaSolidCompression=yes;以管理员权限开启PrivilegesRequired=adminChangesAssociations=yesUninstallable=yesUninstallDisplayName=卸载 {#MyAppName} UninstallDisplayIcon={app}\install.ico WizardImageFile=WizModernImage.bmpWizardSmallImageFile=WizModernSmallImage.bmpVersionInfoVersion={#MyAppVersion} [Languages]Name: "chinesesimp"; MessagesFile: "compiler:Default.isl";创建桌面图标[Tasks]Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone; [Files]Source: "C:\Users\MyPC\Desktop\gameSetup\cn.gloud.arena-20150706-gloud\gloudarena.exe"; DestDir: "{app}"; Flags: ignoreversionSource: "C:\Users\MyPC\Desktop\gameSetup\cn.gloud.arena-20150706-gloud\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirsSource: "install.ico"; DestDir: "{app}"; Flags: ignoreversion ; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”;//桌面图标快捷方式读取.exe[Icons]Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; WorkingDir: "{app}"; [Run]Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent;//注意!代码必须使用[code]段才能够正常运行 [code] //删除所有配置文件以达到干净卸载的目的 procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);begin if CurUninstallStep = usUninstall then //if MsgBox('您是否要删除用户配置信息?', mbConfirmation, MB_YESNO) = IDYES then //删除 {app} 文件夹及其中所有文件 DelTree(ExpandConstant('{app}'), True, True, True);end;//把安装位置在安装的时候写进注册表中,更新安装的时候你读取注册表中已保存的路径procedure InitializeWizard();var ResultStr: String; ResultCode: Integer;begin if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion', 'UninstallString', ResultStr) then begin ResultStr := RemoveQuotes(ResultStr); Exec(ResultStr, '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode); end;end;//检查版本号function GetInstalledVersion(): String; var InstalledVersion: String; begin InstalledVersion :=''; RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion', 'Installed version', InstalledVersion); Result := InstalledVersion;end;//安装、卸载前检查关闭**进程 var HasRun:HWND;function InitializeSetup():Boolean;begin //检测运行应用程序 Result := true; HasRun := FindWindowByWindowName('我的应用'); while HasRun<>0 do begin if MsgBox('安装程序检测到你的应用程序正在运行。' #13#13 '您必须先关闭它然后单击“是”继续安装,或按“否”退出!', mbConfirmation, MB_YESNO) = idNO then begin Result := false; HasRun := 0; end else begin Result := true; HasRun := FindWindowByWindowName('Gloud Arena'); end; end;end;function InitializeUninstall(): Boolean;begin HasRun := FindWindowByWindowName('我的应用'); if HasRun<>0 then begin MsgBox('卸载程序检测到你的应用程序正在运行。' #13#13 '请先退出你的应用程序,然后再进行卸载!', mbError, MB_OK); Result := false; end else Result := true;end;[/code]
—————————————代码结束———————————————-
安装前关闭程序代码:
function InitializeSetup():Boolean;//进程IDvar appWnd: HWND;begin Result := true; //Log('Checking If Running...'); //根据窗体名字获取进程ID appWnd := FindWindowByWindowName('我的应用'); if (appWnd <> 0) then //进程存在,关闭 begin //Log('Is Runing...'); //给进程发送关闭消息 PostMessage(appWnd, 18, 0, 0); // quit end else //进程不存在 begin //Log('Not Runing...'); end;end;
2015-07-21上传360签名的安装包和程序:
下载地址
0 0
- 用inno setup制作安装程序
- delphi Inno Setup 制作安装程序
- 利用Inno Setup制作补丁安装程序
- 使用Inno Setup制作安装程序
- Inno Setup 5制作安装程序
- 免费安装制作程序 Inno Setup
- 程序发布系列 inno setup制作安装程序
- Inno Setup 制作安装程序[支持静默安装.NET环境]
- Inno Setup 制作安装程序[支持静默安装.NET环境]
- Inno Setup制作安装包
- INNO setup 制作安装包
- Inno setup 制作安装包
- Inno Setup 制作的安装程序直接访问Access数据库
- 一分钟学会使用Inno Setup 制作安装程序
- Inno Setup制作安装包--调用外部程序
- Inno Setup制作安装包程序简单示例
- Inno Setup制作实例:Inno Setup安装服务的代码
- 用Inno Setup编译器制作web系统安装包
- 又一个跨平台的快速app开发工具:AppArchitect
- WordPress 为分类添加图片的插件:Categories Images
- 数据库排名sql,group by 分组查询按照时间最大值
- 11个超棒的iOS开发学习网站
- "errmsg" : "not authorized on admin to execute command { $eval: \"return 1111\" }"
- 用inno setup制作安装程序
- 你应该知道 O2O 是什么?
- android http status code
- 如何使用TestFlight进行Beta测试
- 【C++/STL】list的实现(没有采用迭代器和空间配置器所实现的双向链表的基本功能)
- 李彦宏200亿砸百度糯米后 才过了十天就……
- Linux如何上线和下线CPU
- Java Collection框架详解
- winform——文本文档