Adeel Yousafzai
Adeel Yousafzai

Reputation: 57

I can't find wix setup editor to add files to the installer in Visual studio 2015

I can't find wix setup editor to add files to the installer in Visual studio 2015. there is no option of wix setup editor to add the resources and file.

Upvotes: 3

Views: 3633

Answers (1)

Mr Qian
Mr Qian

Reputation: 23808

I can't find wix setup editor to add files to the installer in Visual studio 2015

Actually, adding a new source file to wix project is different from other projects. Right-click on wix project and you cannnot add a new item resource file.

If you want these files shown on the solution explorer, you could add the resource files on the physical project folder path and then

Right-click on the wix project-->Add-->Existing Item-->select the resources files into your project.

However, the actual way to add resource files into wix package is to use Encoding method:

using two elements: a <Component> element to specify an atomic unit of installation and a <File> element to specify the file that should be installed.

You can refer to this document to add a File To Your Installer.

Solution

Add these node in Product.wxs file:

<Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
             
    <Component Id="tests.xml" Guid="86239B6E-FD56-4CB4-938F-0CD84AF85FAC">
        <File Id="tests.xml" Source="xxx\tests.xml(the path of the file)" KeyPath="yes" />
      </Component>
</ComponentGroup>
</Fragment>

Besides, I think you use Wax vs extension in VS2015. If you use this extension, you can set these resource files on Wix Setup Editor.

To add resource files, you should create those resource files on the target project's solution explorer, you can and then you can select them in Wix Setup Editor.

enter image description here.

Also, please make sure that the files's Build Action is set to Content and Copy to Output Directory to Copy always or Copy if newer.

enter image description here

Then, click this option to add it into wix package.

enter image description here

After that, it will add into Product.wxs file automatically.

enter image description here

In addition, you can refer to this document about how to use Wix Setup Editor.

Upvotes: 2

Related Questions