Can't find msi file generated by Setup library project (wix) - wix

I'm following a Wix tutorial that recommends creating a setup library project and writing this in Product.wxs:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="HelloWix" Language="1033" Version="1.0.0" Manufacturer="SoftAgility" UpgradeCode="2CA1BA0A-99C0-445C-8C72-083431F757DE">
<Package Description="Simple Demo" Compressed="yes" />
<MediaTemplate EmbedCab="yes"/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="HelloWix" />
</Directory>
</Directory>
<Component Id="TextFileComponent" Directory="INSTALLFOLDER">
<File Source="C:\temp\MyFile.txt" />
</Component>
<Feature Id="MainFeature" Title="HelloWix" Level="1">
<ComponentRef Id="TextFileComponent" />
</Feature>
</Product>
</Wix>
This project is meant to setup a simple hello world type of setup in order to show the simplest piece of code needed to get a working installation package, with minimal requirements. Build is successful. Question is: where is the .msi generated?

Well, solution is I unloaded the wixproj and changed this line:
<OutputType>Library</OutputType>
to
<OutputType>Package</OutputType>
If you know of other methods, please add them. Thanks!

Related

Simple WIX Installer just coping file doesn't work, what is going wrong?

Here is my code just to copy a file however I don't see any directory created in program files or any notepad.exe file being copied? Where I am going wrong?
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" UpgradeCode="8806367C-FFA1-40C7-B16A-462CF6D941BE"
Name="Test_Product_Name" Version="0.0.1" Manufacturer="Test_Company_Name" Language="1033">
<Package InstallerVersion="200" Compressed="yes" Comments="Windows Installer Package"/>
<Media Id="1" Cabinet="product.cab" EmbedCab="yes"/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="20211022_test">
<Component Id="ApplicationFiles" Guid="172743A1-08E5-483C-96F1-0CE1373F2AF1">
<File Id="ApplicationFile1" Source="notepad.exe"/>
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="DefaultFeature" Level="1">
<ComponentRef Id="ApplicationFiles"/>
</Feature>
</Product>
</Wix>
Your source shows a 32bit MSI so Program Files (x86) is where it'll go.

How can I copy an existing file to a MyDocuments directory in WiX?

TL:DR
How can I tell WiX to copy files from the installer to a specified directory within the user MyDocuments folder?
I'm trying to write a rudimentary installer using WiX.
I've figured out how to reference the projects and the executable, but I want the installer to write a few files to the MyDocuments directory of the user installing the program.
Why not AppData? Because most users don't know how to access the AppData directory and the program should allow the relatively easy access to the files in question, so that they can add or remove the files as they see fit, for good or for ill.
Additionally, if the user decides to remove those files, I would prefer for the program NOT to yell at them when on subsequent runs, as the program has internal checks to make sure the files exist before referencing them, and if they do not, references them internally.
What would I need to add to the following WiX script to tell it "Put MySetupInstallerDocument.txt in MyDocuments/MySetupProject/MySetupProjectFiles" where MySetupInstallerDocument.txt is located within the same folder as the .wxs file?
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product
Id="*" Name="MySetupInstaller" Language="1033" Version="1.0.0.0" Manufacturer=""
UpgradeCode="07a36861-41cf-40e4-a1b6-eb970bc305ff">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade
DowngradeErrorMessage="Bla bla bla" />
<MediaTemplate />
<Feature Id="ProductFeature" Title="MySetupInstaller" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="MySetupInstaller" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="ProductComponent">
<File Source="$(var.MySetupProject.TargetPath)" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

What is it that makes a MSI directory "32-bit" or "64-bit"?

I'm getting very frustrated at the following warnings from light.exe that I'm getting when trying to use a merge module in my WiX installer project within VS2010:
ICE80: This 64BitComponent F_AdaptersInGac.5AE08CC6_EB8E_4F10_AB7B_CEFD0CB0F832
uses 32BitDirectory GAC.5AE08CC6_EB8E_4F10_AB7B_CEFD0CB0F832
(repeated for each file in the merge module).
Both the merge module and the product WiX files are part of the same VS2010 solution. Both merge module and product contain a <Package> element that specifies Platform="x64". The fragment in the merge module .wxs file looks like this:
<Package Id="{5AE08CC6-EB8E-4F10-AB7B-CEFD0CB0F832}" InstallerVersion="200" Languages="1033" Manufacturer="Yoyodyne Propulsion Systems" Platform="x64" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<!-- Assemblies that go in the GAC -->
<Directory Id="GAC" SourceName="GAC">
<Component Id="C_AdaptersInGac" Guid="{C1C7D6F8-197D-874E-79B9-EBFEBDDCB65A}" Win64="yes">
<File Id="F_AdaptersInGac" Name="ERPLink.Adapters.SharePoint.dll" KeyPath="yes" Assembly=".net" Source="..\Internal\Adapters\Release\Contoso.Adapters.dll" />
</Component>
</Directory>
</Directory>
</Directory>
Since I even put my component element inside of the ProgramFiles64Folder directory, and I've marked the platform as "x64", why am I getting this error? What other places control the 64-bitness of a directory in a WiX package file?
A merge module should have an abstraction such as MergeRedirectFolder so that when you consume them in the installer you associate MergeRedirectFolder with the actual [ProgramFiles]Company\Product target using the Directory and Merge elements.
Also if these files are meant to go into the GAC, there is a special folder identifier called GlobalAssemblyCache that can achieve this.
The following just worked for me:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define ComponentRules="OneToOne"?>
<!-- SourceDir instructs IsWiX the location of the directory that contains files for this merge module -->
<?define SourceDir="..\Deploy"?>
<Module Id="StrongNameMM" Language="1033" Version="1.0.0.0">
<Package Id="0085d1f6-e7cf-413e-ae3c-cd1a1e0afb1b" Manufacturer="StrongNameMM" InstallerVersion="200" Platform="x64" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="MergeRedirectFolder">
<Component Id="owc457F6083DF7B557CCA84E132209AC321" Guid="9ab7d95e-7841-3ff9-ffac-87a6b7633636" Win64="yes">
<File Id="owf457F6083DF7B557CCA84E132209AC321" Source="$(var.SourceDir)\ClassLibrary1.dll" KeyPath="yes" Assembly=".net"/>
</Component>
</Directory>
</Directory>
</Module>
</Wix>
Then in the main installer:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<FeatureGroup Id="features">
<Feature Id="StrongName" Title="StrongName" Description="Installs all the files needed for StrongName" Level="1" AllowAdvertise="no" ConfigurableDirectory="INSTALLLOCATION">
<MergeRef Id="StrongNameMM"/>
</Feature>
</FeatureGroup>
<!-- Content -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="CompanyFolder" Name="My Company">
<Directory Id="INSTALLLOCATION" Name="StrongName">
<Merge Id="StrongNameMM" SourceFile="$(var.StrongNameMM.TargetPath)" DiskId="1" Language="1033"/>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
</Wix>
Finally:
<Package InstallerVersion="301" Compressed="yes" InstallScope="perMachine" Platform="x64" />

Converting an EXE file to XML

I have an executable package (.exe) of an application. How do convert this executable to an MSI package?
I am aware of converting a .msi into .wxs using the following.
dark.exe installer.msi
Here's a great little mini-tutorial. It's probably all you need:
http://www.codeproject.com/Tips/105638/A-quick-introduction-Create-an-MSI-installer-with
1) Create Wix XML file
EXAMPLE:
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
</Wix>
2) Build an MSI for your .exe
EXAMPLE:
candle example.wxs
light example.wixobj
3) Voila. If there's nothing more complicated than "install the .exe", you're done!
Take the .msi to a difference PC and test.
The above link also discusses other scenarios, if you need them. For example:
ANOTHER, MORE REALISTIC .WIX FILE:
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" UpgradeCode="12345678-1234-1234-1234-111111111111"
Name="Example Product Name" Version="0.0.1" Manufacturer="Example Company Name" Language="1033">
<Package InstallerVersion="200" Compressed="yes" Comments="Windows Installer Package"/>
<Media Id="1" Cabinet="product.cab" EmbedCab="yes"/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="Example">
<Component Id="ApplicationFiles" Guid="12345678-1234-1234-1234-222222222222">
<File Id="ApplicationFile1" Source="example.exe"/>
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="DefaultFeature" Level="1">
<ComponentRef Id="ApplicationFiles"/>
</Feature>
</Product>
</Wix>
Here is the "standard" tutorial, with much other information:
http://wix.tramontana.co.hu/
Bon soir (at least here in California ;))
'Hope that helps!
Use UniExtract to extract the MSIs from the EXE, then apply dark on the MSIs.

WiX build warning: The Media table has no entries

I'm trying to create a simple installer for a .net application in WiX. I installed Votive and am using the basic template wxs file it creates. When I compile it I get warning LGHT1076: ICE71: The Media table has no entries.
Also when I run the installer it starts and disappears during installation and there is no entry in the Add/Remove Programs app.
Here's the XML:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="26d654fe-af0f-4b48-8993-8e249597a130"
Name="Minefold"
Language="1033"
Version="0.0.0.1"
Manufacturer="Minefold"
UpgradeCode="6aad5a10-cbbe-472b-87fc-0813fb450836">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="Minefold" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="ProductComponent">
<File Source="C:\code\Minefold\Minefold\bin\Debug\Minefold.exe" Id="Minefold.exe" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<Feature Id="Application" Title="Minefold" Level="1">
<ComponentRef Id="ProductComponent" />
</Feature>
</Fragment>
</Wix>
Add a Feature with a ComponentGroupRef to your Product. As written, nothing connects the Product with the content in the Fragments.