inno setup工具创建安装包 注册表注册 浏览器口令打开exe js调用exe程序
1.下载inno setup工具
生成安装包 信息填写后 一路nexe 到生成脚本
下面贴下我的脚本
; 脚本由 Inno Setup 脚本向导 生成!
; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档!
#define MyAppName "Invoked"
#define MyAppVersion "Invoked 1.0 快捷版 V1.0"
#define MyAppPublisher "adage(yskj)"
#define MyAppExeName "Invoked.exe"
[Setup]
; 注: AppId的值为单独标识该应用程序。
; 不要为其他安装程序使用相同的AppId值。
; (生成新的GUID,点击 工具|在IDE中生成GUID。)
AppId={{82ECCC86-0EAF-4F72-BBAE-20F268529F05}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputBaseFilename=InvokedStep
Compression=lzma
SolidCompression=yes
[Languages]
Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
[Files]
Source: "D:\PM_EXE\Invoked.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\PM_EXE\jre\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "D:\PM_EXE\libary\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”
[Registry]
;本段处理程序在注册表中的键值
Root:HKCR;Subkey:Invoked;ValueType:string;ValueName:;ValueData:URL:Invoked Protocol Handler;Flags:uninsdeletevalue
Root:HKCR;Subkey:Invoked;ValueType:string;ValueName:URL Protocol;ValueData:;Flags:uninsdeletevalue
Root:HKCR;Subkey:Invoked\DefaultIcon;ValueType:string;ValueName:;ValueData:{app}\{#MyAppExeName};Flags:uninsdeletevalue
Root:HKCR;Subkey:Invoked\shell;ValueType:string;ValueName:;ValueData:;Flags:uninsdeletevalue
Root:HKCR;Subkey:Invoked\shell\open;ValueType:string;ValueName:;ValueData:;Flags:uninsdeletevalue
Root:HKCR;Subkey:Invoked\shell\open\command;ValueType:string;ValueName:;ValueData:"{app}\{#MyAppExeName} '%1'";Flags:uninsdeletevalue
[Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
把jre环境打包进exe 用户安装直接使用我们包内的jre
Source: "D:\PM_EXE\jre\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
这段为注册表注册的信息 注册到注册表后我们可以通过浏览器输入指定口令访问我们的项目,js 打开exe程序
[Registry]
;本段处理程序在注册表中的键值
Root:HKCR;Subkey:Invoked;ValueType:string;ValueName:;ValueData:URL:Invoked Protocol Handler;Flags:uninsdeletevalue
Root:HKCR;Subkey:Invoked;ValueType:string;ValueName:URL Protocol;ValueData:;Flags:uninsdeletevalue
Root:HKCR;Subkey:Invoked\DefaultIcon;ValueType:string;ValueName:;ValueData:{app}\{#MyAppExeName};Flags:uninsdeletevalue
Root:HKCR;Subkey:Invoked\shell;ValueType:string;ValueName:;ValueData:;Flags:uninsdeletevalue
Root:HKCR;Subkey:Invoked\shell\open;ValueType:string;ValueName:;ValueData:;Flags:uninsdeletevalue
Root:HKCR;Subkey:Invoked\shell\open\command;ValueType:string;ValueName:;ValueData:"{app}\{#MyAppExeName} '%1'";Flags:uninsdeletevalue
成功截图
上一篇: asp.net获取客户端IP地址网卡等
下一篇: ValidNumber.ashx验证码