inno setup 打包
; -- Example1.iss -- ; Demonstrates copying 3 files and creating an icon. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES! [Setup] AppName=test AppVersion=1.0 DefaultDirName="C:\test" Compression=lzma2/max SolidCompression=yes MergeDuplicateFiles=yes ;WindowVisible=no Uninstallable=yes ;dir Dialog 让用户自己安装目录么? DisableDirPage=yes DisableFinishedPage=yes DefaultGroupName=开始菜单项名字
DisableProgramGroupPage=yes
;不要添加开始菜单项 DisableReadyPage=yes DisableWelcomePage=yes PrivilegesRequired=admin [Files] Source: "C:\1\a.ini"; DestDir: "{app}" ;CopyMode:alwaysoverwrite Source: "C:\1\b.ocx"; DestDir: "{app}"; Flags:ignoreversion regserver ;CopyMode:alwaysoverwrite [Registry] ;Flags: uninsdeletekey 卸载时删除。 Flags: uninsdeletekeyifempty 卸载时保留。一般。。。。。算了,删除吧。
;从100开始是因为怕和 其他的受信任站点冲突、 但是后来发现100失败,从1开始才OK,或许没有1,会失败
;DWORD dwType 2--受信任站点 4--受限制站 ;64bit Root: HKCU64; Check: IsWin64; Subkey: "Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range1"; Flags: uninsdeletekey ;
Root: HKCU64; Check: IsWin64; Subkey: "Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range1"; ValueType: dword; ValueName: "http"; ValueData: "2"
Root: HKCU64; Check: IsWin64; Subkey: "Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range1"; ValueType: string; ValueName: ":Range"; ValueData: "192.168.1-255.*";
;32bit Root: HKCU32; Check: not IsWin64; Subkey: "Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range1"; Flags: uninsdeletekey
Root: HKCU32; Check: not IsWin64; Subkey: "Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range1"; ValueType: dword; ValueName: "http"; ValueData: "2"
Root: HKCU32; Check: not IsWin64; Subkey: "Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range1"; ValueType: string; ValueName: ":Range"; ValueData: "192.168.1-255.*";
;[Setup] ;ArchitecturesInstallIn64BitMode=x64 ;ArchitecturesAllowed = x64 ;This means that under 64-bit processor architecture 64-bit mode will be used. You can specify Itanium architecture (ArchitecturesInstallIn64BitMode=ia64) if necessary. ;Now imagine you need to use one file for 32-bit mode and another file for 64-bit mode. You can do it in the following way: ;[Files] ;Source: "OurProgram\Release\shellextension.dll"; DestDir: "{app}"; Flags: regserver ignoreversion; Check: not Is64BitInstallMode; ;Source: " OurProgram \x64\Release\shellextension.dll"; DestDir: "{app}"; Flags: regserver ignoreversion; Check: Is64BitInstallMode;
[Icons]
;Name: "{userdesktop}\快捷方式名字";Filename: "{app}\app.exe"; WorkingDir: "{app}"
Name: "{group}\快捷方式名字"; Filename: "{app}\app.exe";
Name: "{group}\{cm:UninstallProgram,}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\程序名字"; Filename: "{app}\app.exe"
做安装包的起因(Win7下UAC权限管理问题)
1.注册控件没有权限
2.控件在IE浏览器中没有读写文件的权限,所以需要做处理。
inno setup,还算简单,就是文档不是很多,官方reference,感觉都不够详细。得靠猜。
比如 检查是否为64位系统 用Check:IsWin64,
那32位不是Check: IsWin32 而是 Check: not IsWin64。
==========================================导出的文件trust.reg
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range100]
"http"=dword:00000002
":Range"="127.0.0.1"