好友
阅读权限10
听众
最后登录1970-1-1
|
Aermu
发表于 2023-11-20 10:51
本帖最后由 Aermu 于 2023-11-20 15:35 编辑
我有5个exe安装包,假设分别是【1.exe】【2.exe】【3.exe】【4.exe】【5.exe】,静默安装参数都为/S
因为一个一个安装有些麻烦,就想着打包成一个安装包,运行的时候可以一次性安装好,查了一些教程大概是可以写成下面这个样子。。。
*********************************************************************
[Types]
Name: default; Description: "默认安装";
Name: custom; Description: "自定义安装"; Flags: iscustom
[Components]
Name: s1; Description: 1; Types: default custom
Name: s2; Description: 2; Types: default custom
Name: s3; Description: 3; Types: default custom
Name: s4; Description: 4; Types: default custom
Name: s5; Description: 5; Types: default custom
[Files]
Source: “softwares\1.exe”; DestDir: "{app}"
Source: ”softwares\2.exe”; DestDir: "{app}"
Source: ”softwares\3.exe”; DestDir: "{app}"
Source: ”softwares\4.exe”; DestDir: "{app}"
Source: ”softwares\5.exe”; DestDir: "{app}"
[Run]
Filename: "{app}\1.exe"; Parameters:"/S"; Components: "s1"
Filename: "{app}\2.exe"; Parameters:"/S"; Components: "s2"
Filename: "{app}\3.exe"; Parameters:"/S"; Components: "s3"
Filename: "{app}\4.exe"; Parameters:"/S"; Components: "s4"
Filename: "{app}\5.exe"; Parameters:"/S"; Components: "s5"
*********************************************************************
然后现在我有一个问题就是,运行这个编译生成的安装包 【MyProgram.exe】 后,它会先把这些安装包都解压到 【C:\Program Files (x86)\MyProgram】 文件夹下,然后再把这5个软件静默安装,同时也会在控制面板的卸载程序里生成一个 MyProgram 的条目。
想请问各位大佬,有没有什么办法可以让它不将这些安装包解压出来,直接安装,也不在控制面板那里新增MyProgram的东西。
=====================【 二编 】======================
*********************************************************************
[Setup]
......
DefaultDirName={tmp}
Uninstallable=no
[Types]
Name: default; Description: "默认安装";
Name: custom; Description: "自定义安装"; Flags: iscustom
[Components]
Name: s1; Description: 1; Types: default custom
Name: s2; Description: 2; Types: default custom
Name: s3; Description: 3; Types: default custom
Name: s4; Description: 4; Types: default custom
Name: s5; Description: 5; Types: default custom
[Files]
Source: “softwares\1.exe”; DestDir: "{tmp}"
Source: ”softwares\2.exe”; DestDir: "{tmp}"
Source: ”softwares\3.exe”; DestDir: "{tmp}"
Source: ”softwares\4.exe”; DestDir: "{tmp}"
Source: ”softwares\5.exe”; DestDir: "{tmp}"
[Run]
Filename: "{tmp}\1.exe"; Parameters:"/S"; Components: "s1"
Filename: "{tmp}\2.exe"; Parameters:"/S"; Components: "s2"
Filename: "{tmp}\3.exe"; Parameters:"/S"; Components: "s3"
Filename: "{tmp}\4.exe"; Parameters:"/S"; Components: "s4"
Filename: "{tmp}\5.exe"; Parameters:"/S"; Components: "s5"
*********************************************************************
参考几位大佬的回答,改成这个样子,运行 MyProgram.exe 安装后,在安装过程中解压到临时目录的文件都自己删除了,控制面板里也没有了 MyProgram 的条目。
现在有一个新的问题,就是在选择组件的界面最下方有一个【当前选择的组件至少需要 100 MB 的磁盘空间】,100 MB 是这 5 个软件安装包的总大小(假设每个安装包大小为 20 MB),
界面下方的提示的数值大小并不会根据我勾选的组件数量而产生变化,也就是说它依然是先将所有安装包都解压到临时目录(尽管我没有选择它),最后才会根据我勾选的组件来进行静默安装。
请问各位大佬,有没有什么办法可以让它只解压我勾选的组件吗?
=====================【三编(已解决) 】======================
*********************************************************************
[Setup]
......
DefaultDirName={tmp}
Uninstallable=no
ShowComponentSizes=yes
[Types]
Name: default; Description: "默认安装";
Name: custom; Description: "自定义安装"; Flags: iscustom
[Components]
Name: s1; Description: 1; Types: default custom
Name: s2; Description: 2; Types: default custom
Name: s3; Description: 3; Types: default custom
Name: s4; Description: 4; Types: default custom
Name: s5; Description: 5; Types: default custom
[Files]
Source: “softwares\1.exe”; DestDir: "{tmp}"; Components: s1
Source: ”softwares\2.exe”; DestDir: "{tmp}"; Components: s2
Source: ”softwares\3.exe”; DestDir: "{tmp}"; Components: s3
Source: ”softwares\4.exe”; DestDir: "{tmp}"; Components: s4
Source: ”softwares\5.exe”; DestDir: "{tmp}"; Components: s5
[Run]
Filename: "{tmp}\1.exe"; Parameters:"/S"; Components: "s1"
Filename: "{tmp}\2.exe"; Parameters:"/S"; Components: "s2"
Filename: "{tmp}\3.exe"; Parameters:"/S"; Components: "s3"
Filename: "{tmp}\4.exe"; Parameters:"/S"; Components: "s4"
Filename: "{tmp}\5.exe"; Parameters:"/S"; Components: "s5"
*********************************************************************
|
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|