问题描述
我要创建我的应用程序一个安装的安装程序。我已经下载的WiX 3.6和它安装在VS 2012。
I want to create a setup installer for my application. I have downloaded WiX 3.6 and installed it on vs 2012.
- 创建简单的WinForm应用程序
- 添加维克斯安装项目,以我的解决方案
- 右键点击引用,我的WinForm应用程序添加到设置的参考
- 我建立的解决方案并进入调试目录设置项目并运行SetupProject1.exe.msi它不工作并关闭安装程序对话框中没有任何错误。
- Create simple winform application
- Add WiX setup project to my solution
- Right click on reference and add my winform application to setup's reference
- I build solution and go to debug directory in setup project and run SetupProject1.exe.msi it does not work and closes the installer dialog without any error.
返回设定项目
- 右键单击安装项目,然后选择属性
- 在安装选项卡>输出类型,将其更改为executablefile.exe
- 构建它,去调试和运行SetupProject1.exe - 仍然不能正常工作
什么是错的?这是我的安装项目product.wxs
What is wrong? This is my setup project product.wxs
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="Natiloos" UpgradeCode="cfc2f4dd-2da5-49e2-9099-96968d75aaa4">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="SetupProject1" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="SetupProject1" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<!-- <Component Id="ProductComponent"> -->
<!-- </Component> -->
</ComponentGroup>
</Fragment>
我怎样才能让安装程序正确建立?
How can I get the installer to build correctly?
推荐答案
问题是您的安装不安装任何东西。添加您的项目作为安装程序的引用,并不意味着安装程序将包括您的项目输出。在您的安装项目有:
The problem is your installer is not installing anything. Adding your project as a reference to the installer does not mean the installer will include your projects output. In your setup project you have:
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<!-- <Component Id="ProductComponent"> -->
<!-- </Component> -->
</ComponentGroup>
</Fragment>
您需要添加文件...即。取消注释<成分>< /成分>
标签和手动添加文件。这是很好的有一个<成分>每个文件
标签
You need to add the files...i.e. uncomment the <Component></Component>
tags and add your files manually. It's good to have one <Component>
tag per file.
例如:
<Component Id="MyProgram.exe" Guid="PUT-GUID-HERE">
<File Id="MyProgram.exe" KeyPath="yes" Source="Path_To_Output_Folder\MyProgram.exe" />
</Component>
这篇关于WiX的安装程序不VS 2012上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!