如何创建安装程序,以安装第三方安装程序(exe)并将自定义文件定位到同一目录? [英] How to create a installer, that installs a 3rd-Party Setup (exe) and locates custom files to the same directory?
问题描述
我希望这个标题有意义,并且不会误导我的请求。
I hope this title is meaningful, and is not misleading my request.
我想将我的应用程序部署为安装文件,需要第三方依赖项。
目标:Windows 7/8
I want to deploy My Application as a setup file, that requires 3rd-Party dependencies.
Target: Windows 7/8
- 我应用程序(C#.NET项目)
- 第三方工具(.exe设置)
- [-]此外,还向系统添加了RegKeys ,具体取决于稍后我的应用程序所需的设置向导中选择的选项。
- [+]支持静默安装(带参数)
-
setup.exe / S / D = C:\Program Files(x86)\3rd-Party
- My Application (C#.NET project)
- 3rd-Party Tool (.exe setup)
- [-] Additionally adds RegKeys to the system, depending on the chosen options in the setup wizard that are required for My Application later on.
- [+] Supports silent install (with arguments)
setup.exe /S /D="C:\Program Files (x86)\3rd-Party"
我的应用应存储在与第3个相同的目录中Party。
因此,命令是静默安装setup.exe,并在完成后进行安装。 我的应用程序应该位于同一位置。
安装程序可以选择检查是否已经安装了 3rd-Party ,但这不是必须的,因为静默安装/ S
不会对原始文件进行任何更改或引起任何问题。My Application should be stored in the same directory as the 3rd-Party.
So the order would be to silently install the setup.exe, and after it's finished; My Application should be located the same place.
Optionally the setup could check if the 3rd-Party is installed already, but that is not necessary, since the silence installation/S
would not make any changes or cause any problems to the original.安装向导应该跟进以下页面:
The setup wizard should follow up with the following pages:
Setup StartPage -> Licens agreement -> Choose installion path -> Progress -> Finish.
选择安装应该指向一个变量,该变量将用于第三方应用程序和我的应用程序的静默安装。
The Choose installation should point to a variable, which will be used for the silent installation of the 3rd-Party application and My Application.
您建议做什么在这种情况下使用?(请仅提供免费解决方案)
我简要介绍了Inno-Setup和WiX,但对于这件小事,它们似乎有些矫kill过正。
此外,我想指出的是,我没有安装脚本语言的经验。 (时间常数)What do you recommend to use in this case? (only free solutions please)
I'd a brief look into Inno-Setup and WiX, but they seemed a bit overkill for this little thing.
Furthermore I want to point that I do not have experience with the script-languages of setups. (time constant)推荐答案
您还需要吗?使用WiX,这将非常简单:您需要创建两个项目:一个MSI,用于打包您的多余文件,然后将该MSI和现有的setup.exe放入WiX捆绑包中。
可以将参数传递给setup.exe,使其以静默方式安装,但是您必须首先生成响应文件。 (使用/ s / r运行安装程序,然后通常在C:\Windows中找到setup.iss文件。)然后必须通过< InstallCommand>传递这些文件。和转义引号可能很棘手。不要将setup.exe本身作为参数传递。要查看最终通过的内容,请查看安装日志。
Do you still need this? With WiX that this would be fairly straightforward: you need make two projects: an MSI which packages your extra files, and then put that MSI and the existing setup.exe into a WiX bundle.
Passing the arguments to the setup.exe so it installs silently can be done, but you have to generate a response file first. (run the setup with /s /r, and then find the setup.iss file, usually in C:\Windows.) And then you have to pass those via <InstallCommand> and escaping the quotes can be tricky. Don't pass setup.exe itself as an argument. To see what eventually gets passed, look at the install log.以下是捆绑软件所需内容的概述,其中大部分是完整的代码:(
Below is an outline of what you need for the bundle, mostly complete code: (you'll have to come up with id's, and set the paths to where things are on your machine obviously).
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"> <Bundle Name="some-cool-name-for-the-whole-thing" Version="1.0" UpgradeCode="your-guid-here"> <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense"> <bal:WixStandardBootstrapperApplication LicenseUrl="" ShowVersion="yes"/> </BootstrapperApplicationRef> <Chain> <ExePackage Id="some_id" SourceFile="path-to-the-setup.exe"> <CommandLine InstallArgument="/s /f1"fullpath-to-your-iss-file.iss"/> </ExePackage> <MsiPackage Id="some-other-id-here" SourceFile="path-to-the-MSI-you-made-for-your-app"> </MsiPackage> </Chain> </Bundle> </Wix>
对于MSI,再次大致概述您需要的内容:
For the MSI, again a mostly complete outline of what you need:<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="*" Name="name-of-your-app" UpgradeCode="some-unique-constant-guid-across-versions"> <Package InstallerVersion="500" Compressed="yes"<br> InstallScope="PerMachine"/> <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> <MediaTemplate EmbedCab="yes" /> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> <Directory Id="my_app_install_dir" Name="My App" /> </Directory> </Directory> <ComponentGroup Id="the-component-group-id" Directory="my_app_install_dir"> <Component Id="some-other-id-name" Guid="{some-new-GUID}" > <File Id="some-id-1-for-your-file" Source="path-to-your-file" KeyPath="yes" /> </Component> <Component Id="some-other-id2-name" Guid="{some-new-GUID2}"> <File Id="some-id-2-for-your-another-file" Source="path-to-another-file" KeyPath="yes" /> </Component> <!-- add more files as needed --> </ComponentGroup> <Feature Id="some-feature-id" Title="some-title" Level="1"> <ComponentGroupRef Id="the-component-group-id" /> </Feature> </Product> </Wix>
这篇关于如何创建安装程序,以安装第三方安装程序(exe)并将自定义文件定位到同一目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!