inno setup问题 不知道应该发到哪个版面上. 问一个关于inno setup的问题,怎么在code中判断某个组件已选,组件页面的变量名是什么呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 仔细看看Inno Step的帮助文件!!里面应该会有答案的 为什么要判断组件已选?是要类似 Office 安装那样的效果吗? Inno 好象实现不了它只不过是最简单的打包软件罢了要想 实现你要求的效果 建议用My InstallShield 这个功能非常强大,用起来也不是很麻烦 My InstallShield 也是开源的软件吗? 如果是在wpSelectComponents页面的话,[Types]Name: "custom"; Description: "自定义安装"; Flags: iscustomName: "full"; Description: "完全安装"[Components]Name: "mainApplication"; Description: "服务器应用主程序"; Types: custom full; Flags: fixedName: "authority"; Description: "权限管理文件"; Types: fullName: "database"; Description: "数据库"; Types: fullvar ComponentsSelected: string[Code]function NextButtonClick(CurPageID: Integer): Boolean;beginif CurPageID=wpSelectComponents then ComponentsSelected:=WizardselectedComponents(True); if (Pos('数据库',ComponentsSelected)>0 then begin { do what you want } end; inno自带的Demo中有个CodeExample1.iss你可以参考[Files]Source: "MyProg.exe"; DestDir: "{app}"; Check: MyProgCheck; BeforeInstall: BeforeMyProgInstall('MyProg.exe'); AfterInstall: AfterMyProgInstall('MyProg.exe')其中AfterInstall: AfterMyProgInstall的AfterMyProgInstall是个自定义的执行过程procedure AfterMyProgInstall(S: String);begin MsgBox('AfterMyProgInstall:' #13#13 'Setup just installed ' + S + ' as ' + CurrentFileName + '.', mbInformation, MB_OK);end; 每个组件你可以设置一个注册表的值,下面三个函数可以对注册表进行判断、取值、写值操作。RegKeyExistsRegQueryStringValueRegWriteStringValue 语法:function IsComponentSelected(const Components: String): Boolean;描述:如果选定了指定的组件则返回 True。可以在同一方式用一个组件参数指定多个组件。示例:begin if IsComponentSelected('helpfiles') then // the 'helpfiles' component is selectedend; 楼上的使用方法更简单至于 如何[code]段中执行MSI格式的程序的脚本我只在[Run]段执行过MSI格式的程序的脚本[Run]Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\abc.msi"" /quiet"; 怎么实现在菜单中加入编辑框 realaudio1控件本身的播放暂停工具条的隐藏设置~ 关于写服务的.SERVICE delphi中怎样解决字符串数据右截位的问题???急----急--- 如何禁止鼠标拖动文本?(在线等待,急) 数据库高手帮忙!!! 过年了,分数太多,散点分之8 Opengl 的高手救命啊, delphi里如何在已显示的图像上任意选取? 高手、低手一起进来 有关于SQL语句的问题。 刚刚知道的秘密,可能有些人还不知道吧! 能不能实现对panel控件画图的同时也画到一个bmp对象上?
它只不过是最简单的打包软件罢了
要想 实现你要求的效果 建议用My InstallShield
这个功能非常强大,用起来也不是很麻烦
也是开源的软件吗?
wpSelectComponents页面的话,
[Types]
Name: "custom"; Description: "自定义安装"; Flags: iscustom
Name: "full"; Description: "完全安装"[Components]
Name: "mainApplication"; Description: "服务器应用主程序"; Types: custom full; Flags: fixed
Name: "authority"; Description: "权限管理文件"; Types: full
Name: "database"; Description: "数据库"; Types: fullvar ComponentsSelected: string
[Code]
function NextButtonClick(CurPageID: Integer): Boolean;
begin
if CurPageID=wpSelectComponents then
ComponentsSelected:=WizardselectedComponents(True);
if (Pos('数据库',ComponentsSelected)>0 then
begin
{ do what you want }
end;
Source: "MyProg.exe"; DestDir: "{app}"; Check: MyProgCheck; BeforeInstall: BeforeMyProgInstall('MyProg.exe'); AfterInstall: AfterMyProgInstall('MyProg.exe')其中AfterInstall: AfterMyProgInstall的AfterMyProgInstall是个自定义的执行过程procedure AfterMyProgInstall(S: String);
begin
MsgBox('AfterMyProgInstall:' #13#13 'Setup just installed ' + S + ' as ' + CurrentFileName + '.', mbInformation, MB_OK);
end;
RegKeyExists
RegQueryStringValue
RegWriteStringValue
function IsComponentSelected(const Components: String): Boolean;描述:
如果选定了指定的组件则返回 True。可以在同一方式用一个组件参数指定多个组件。示例:
begin
if IsComponentSelected('helpfiles') then
// the 'helpfiles' component is selected
end;
至于 如何[code]段中执行MSI格式的程序的脚本我只在[Run]段执行过MSI格式的程序的脚本
[Run]
Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\abc.msi"" /quiet";