WiX Windows service install failure - windows

I am trying to use WiX for my service installation.
This tries to install my service but eventually fails. Do you have any idea?
My service should use a local user account. This account was added as "users which can run window services".
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="*" Name="MySvcSetup" Language="1033" Version="1.0.0.0" Manufacturer="CMPY" UpgradeCode="aae1a2bc-2ae0-409b-adc4-77cc7fc06a87">
<Package InstallerVersion="200" Compressed="yes" AdminImage="yes" InstallScope="perMachine" InstallPrivileges="elevated" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="MySvcSetup" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<Property Id="MSIUSEREALADMINDETECTION" Value="1" />
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="SLBFOLDER" Name="CMPY">
<Directory Id="INSTALLFOLDER" Name="My Service" />
</Directory>
</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" Guid="{15554AD5-F373-453A-88B9-BE1112A6C804}">
<!--TODO: Insert files, registry keys, and other resources here.-->
<File Id="MySvc.exe" Name="MySvc.exe" Source="..\..\..\..\Services\xxx\bin\Release\MySvc.exe" Vital="yes" KeyPath="yes" DiskId="1"/>
<File Id="Encryption.dll" Name="Encryption.dll" Source="..\..\..\..\Services\xxx\bin\Release\Encryption.dll" Vital="yes" KeyPath="no" DiskId="1"/>
<ServiceInstall
Id="MySvc.exe"
Type="ownProcess"
Vital="yes"
Name="MySvc"
DisplayName="My service"
Description="...."
Start="auto"
Account=".\MySvcUser"
Password="CN9P4CvTRo"
ErrorControl="ignore"
Interactive="no">
<util:PermissionEx
ChangePermission="yes"
Delete="yes"
GenericAll="yes"
ReadPermission="yes"
ServiceChangeConfig="yes"
ServiceEnumerateDependents="yes"
ServiceInterrogate="yes"
ServicePauseContinue="yes"
ServiceQueryConfig="yes"
ServiceQueryStatus="yes"
ServiceStart="yes"
ServiceStop="yes"
ServiceUserDefinedControl="yes"
Synchronize="yes"
TakeOwnership="no"
User=".\MySvcUser"
/>
<util:ServiceConfig
FirstFailureActionType="restart"
SecondFailureActionType="restart"
ThirdFailureActionType="restart"
RestartServiceDelayInSeconds="60"
ResetPeriodInDays="0" />
</ServiceInstall>
<ServiceControl Id="MySvc.exe" Start="install" Stop="both" Remove="uninstall" Name="GTCollector" Wait="yes" />
</Component>
</ComponentGroup>
</Fragment>

Try
Account="LocalSystem"
instead of
Account=".\MySvcUser"

Related

What is the proper way to add multiple class library projects in wix installer

I am trying to create a wix installer for window service. My service consists four class library projects. My questions is how can i add multiple class library projects in wix installer. I followed this link https://github.com/Robs79/How-to-create-a-Windows-Service-MSI-Installer-Using-WiX/blob/master/WindowsService.Installer/Product.wxs its not shows how to add multiple class library projects. Please some one help me out how can do this. or provide some reference link where i can refer.
Thanks in Advance
Product.wxs:
<?define Manufacturer = "IRIZ ID TECH" ?>
<?define VersionNumber = "1.0.0.0" ?>
<?define UpgradeCode = "{FF9D7B21-A4FE-4DEB-A2FE-E77228F95831}" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
UpgradeCode="$(var.UpgradeCode)"
Version="$(var.VersionNumber)"
Language="1033"
Name="$(var.Name)"
Manufacturer="$(var.Manufacturer)">
<Package InstallerVersion="300" Compressed="yes" InstallScope="perMachine" />
<Media Id="1" Cabinet="ESS_VillageMateIntegrtion" EmbedCab="yes"></Media>
<!-- Allow upgrades and prevent downgrades -->
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="WindowsService.Installer" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<!-- Define the directory structure -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="ROOTDIRECTORY" Name="$(var.Manufacturer)">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="$(var.Name)" />
</Directory>
</Directory>
</Directory>
</Fragment>
<!-- Add files to your installer package -->
<Fragment>
<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
<Component Id="$(var.ESS_VillageMateIntegrtion.TargetFileName)" Guid="{F03996CC-3A49-47A7-91F1-27DBF563AE83}">
<File Id="$(var.ESS_VillageMateIntegrtion.TargetFileName)" Source="$(var.ESS_VillageMateIntegrtion.TargetPath)" KeyPath="yes" />
</Component>
<Component Id="$(var.ESS_VillageMateIntegrtionServiceConfig.TargetFileName)" Guid="{CC064C9B-298A-4D6D-AF64-40DA3657AAAB}">
<File Id="$(var.ESS_VillageMateIntegrtionServiceConfig.TargetFileName)" Source="$(var.ESS_VillageMateIntegrtionServiceConfig.TargetPath)" KeyPath="yes" />
</Component>
<Component Id="$(var.ESS_VillageMateService.TargetFileName)" Guid="{CB37D43D-BB08-4DF2-A7B0-87A819A66CED}">
<File Id="$(var.ESS_VillageMateService.TargetFileName)" Source="$(var.ESS_VillageMateService.TargetPath)" KeyPath="yes" />
</Component>
<Component Id="$(var.ESS_VillageMateIntegrationTray.TargetFileName)" Guid="{71FD65C9-A657-4093-8D5A-28743972E536}">
<File Id="$(var.ESS_VillageMateIntegrationTray.TargetFileName)" Source="$(var.ESS_VillageMateIntegrationTray.TargetPath)" KeyPath="yes" />
</Component>
<Component Id="Components">
<!-- Remove the log file on uninstall -->
<RemoveFile Id="log" Name="*.txt" On="both" />
<!-- Tell WiX to install the Service -->
<ServiceInstall Id="ServiceInstaller"
Type="ownProcess"
Vital="yes"
Name="ESS_VillageMateIntegrtion"
DisplayName="ESS_VillageMateIntegrtion Service"
Description="Write Data one DB to another DB"
Start="auto"
Account="LocalSystem"
ErrorControl="normal" />
<!-- Tell WiX to start the Service -->
<ServiceControl Id="StartService"
Start="install"
Stop="both"
Remove="uninstall"
Name="ESS_VillageMateIntegrtion"
Wait="yes" />
</Component>
</DirectoryRef>
</Fragment>
</Wix>

custom event not executing while first time setup using wix installer

I am trying to develop an application using SingnalR which will install into client machine and continuously give me update on a particular port. I made client setup using WIX and added a custom event to register port to the client machine. Now the issue is, while I am going to run the setup for the first time on client's machine, my custom event is not getting fired. But if I run the installer for second time, it is getting fired. I don't know what is the issue.
.wxs file is as below,
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define WixSetup2_TargetDir=$(var.WixSetup2.TargetDir)?>
<Product Id="*" Name="TestCompany" Language="1033" Version="1.0.0.0" Manufacturer="Test" UpgradeCode="aacb5b21-2f9c-4d93-b47c-d6ec8868dc65">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" AdminImage="yes" />
<MajorUpgrade DowngradeErrorMessage="A newer version of Test is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="SetupProject1" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="ProgramFilesFolder_files" />
</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">
<Component Id="WixSetup2.exe" Guid="ca9e28f3-b059-48db-ae8c-3ea39c471644">
<File Id="WixSetup2.exe" Name="WixSetup2.exe" Source="$(var.WixSetup2_TargetDir)WixSetup2.exe" />
</Component>
<Component Id="WixSetup2.exe.config" Guid="3ac3746a-c59e-450d-a575-4c137c959309">
<File Id="WixSetup2.exe.config" Name="WixSetup2.exe.config" Source="$(var.WixSetup2_TargetDir)WixSetup2.exe.config" />
</Component>
<Component Id="Owin.dll" Guid="7610272c-0faa-40b9-b633-1f251d05c360">
<File Id="Owin.dll" Name="Owin.dll" Source="$(var.WixSetup2_TargetDir)Owin.dll" />
</Component>
<Component Id="Microsoft.AspNet.SignalR.Core.dll" Guid="0bb82458-a72a-49e5-adbe-36d3521f8322">
<File Id="Microsoft.AspNet.SignalR.Core.dll" Name="Microsoft.AspNet.SignalR.Core.dll" Source="$(var.WixSetup2_TargetDir)Microsoft.AspNet.SignalR.Core.dll" />
</Component>
<Component Id="Microsoft.AspNet.SignalR.SystemWeb.dll" Guid="8f06a4f7-93fe-45f3-a82a-ed5d5f102d17">
<File Id="Microsoft.AspNet.SignalR.SystemWeb.dll" Name="Microsoft.AspNet.SignalR.SystemWeb.dll" Source="$(var.WixSetup2_TargetDir)Microsoft.AspNet.SignalR.SystemWeb.dll" />
</Component>
<Component Id="Microsoft.Owin.dll" Guid="98e2aa07-583d-4fe5-bf0b-04c7dd544899">
<File Id="Microsoft.Owin.dll" Name="Microsoft.Owin.dll" Source="$(var.WixSetup2_TargetDir)Microsoft.Owin.dll" />
</Component>
<Component Id="Microsoft.Owin.Hosting.dll" Guid="8e662dd5-27ee-46fc-aa66-513e2a2620ef">
<File Id="Microsoft.Owin.Hosting.dll" Name="Microsoft.Owin.Hosting.dll" Source="$(var.WixSetup2_TargetDir)Microsoft.Owin.Hosting.dll" />
</Component>
<Component Id="Microsoft.Owin.Cors.dll" Guid="ec90a805-82c9-4293-8ef7-83b8b2675e2d">
<File Id="Microsoft.Owin.Cors.dll" Name="Microsoft.Owin.Cors.dll" Source="$(var.WixSetup2_TargetDir)Microsoft.Owin.Cors.dll" />
</Component>
<Component Id="System.Web.Cors.dll" Guid="7aa9db0e-51af-4b46-bb5d-abebc7e66285">
<File Id="System.Web.Cors.dll" Name="System.Web.Cors.dll" Source="$(var.WixSetup2_TargetDir)System.Web.Cors.dll" />
</Component>
<Component Id="Newtonsoft.Json.dll" Guid="ade7f021-743d-4d36-8fcd-c1a991f4b133">
<File Id="Newtonsoft.Json.dll" Name="Newtonsoft.Json.dll" Source="$(var.WixSetup2_TargetDir)Newtonsoft.Json.dll" />
</Component>
<Component Id="Microsoft.Owin.Host.SystemWeb.dll" Guid="38f6eaab-041a-401c-8fdb-2f841fbcea6a">
<File Id="Microsoft.Owin.Host.SystemWeb.dll" Name="Microsoft.Owin.Host.SystemWeb.dll" Source="$(var.WixSetup2_TargetDir)Microsoft.Owin.Host.SystemWeb.dll" />
</Component>
<Component Id="Microsoft.Owin.Security.dll" Guid="82ef20d9-562b-4bf4-85a0-4ea446bc5095">
<File Id="Microsoft.Owin.Security.dll" Name="Microsoft.Owin.Security.dll" Source="$(var.WixSetup2_TargetDir)Microsoft.Owin.Security.dll" />
</Component>
<Component Id="Microsoft.Owin.Host.HttpListener.dll" Guid="a00da1a6-563b-4318-8bcc-eb21c5c7d7bd">
<File Id="Microsoft.Owin.Host.HttpListener.dll" Name="Microsoft.Owin.Host.HttpListener.dll" Source="$(var.WixSetup2_TargetDir)Microsoft.Owin.Host.HttpListener.dll" />
</Component>
<Component Id="Microsoft.Owin.Diagnostics.dll" Guid="c5e44f7a-6961-4e9c-b2af-5d4a7e8d8b9d">
<File Id="Microsoft.Owin.Diagnostics.dll" Name="Microsoft.Owin.Diagnostics.dll" Source="$(var.WixSetup2_TargetDir)Microsoft.Owin.Diagnostics.dll" />
</Component>
</ComponentGroup>
<CustomAction Id="addPort" Directory="INSTALLFOLDER" Execute="immediate" Impersonate="no" ExeCommand="[SystemFolder]netsh.exe http add urlacl http://*:1919/ user=Everyone" Return="check">
</CustomAction>
<InstallExecuteSequence>
<Custom Action="addPort" Before="InstallExecute">Installed</Custom>
</InstallExecuteSequence>
</Fragment>
<Fragment>
<ComponentGroup Id="ProgramFilesFolder_files" Directory="INSTALLFOLDER">
<Component Id="Scripts_jquery_3.1.1.intellisense.js" Guid="e47264ab-facd-4c3b-9372-69e2f972fb44">
<File Id="Scripts_jquery_3.1.1.intellisense.js" Name="jquery-3.1.1.intellisense.js" Source="$(var.WixSetup2_TargetDir)Scripts\jquery-3.1.1.intellisense.js" />
</Component>
<Component Id="Scripts_jquery_3.1.1.js" Guid="b51ca2fd-3c8a-461e-8340-e26b90dbeb4c">
<File Id="Scripts_jquery_3.1.1.js" Name="jquery-3.1.1.js" Source="$(var.WixSetup2_TargetDir)Scripts\jquery-3.1.1.js" />
</Component>
<Component Id="Scripts_jquery_3.1.1.min.js" Guid="df63a174-bf0e-40ca-b634-aac1a9777afa">
<File Id="Scripts_jquery_3.1.1.min.js" Name="jquery-3.1.1.min.js" Source="$(var.WixSetup2_TargetDir)Scripts\jquery-3.1.1.min.js" />
</Component>
<Component Id="Scripts_jquery_3.1.1.slim.js" Guid="63ddd1f4-b695-4441-8ce2-f81473069868">
<File Id="Scripts_jquery_3.1.1.slim.js" Name="jquery-3.1.1.slim.js" Source="$(var.WixSetup2_TargetDir)Scripts\jquery-3.1.1.slim.js" />
</Component>
<Component Id="Scripts_jquery_3.1.1.slim.min.js" Guid="15b3bc22-b845-4d65-9c4b-baf654959531">
<File Id="Scripts_jquery_3.1.1.slim.min.js" Name="jquery-3.1.1.slim.min.js" Source="$(var.WixSetup2_TargetDir)Scripts\jquery-3.1.1.slim.min.js" />
</Component>
<Component Id="Scripts_jquery.signalR_2.2.1.js" Guid="915b874f-398a-4e9e-af24-e68045ffca71">
<File Id="Scripts_jquery.signalR_2.2.1.js" Name="jquery.signalR-2.2.1.js" Source="$(var.WixSetup2_TargetDir)Scripts\jquery.signalR-2.2.1.js" />
</Component>
<Component Id="Scripts_jquery.signalR_2.2.1.min.js" Guid="085dd028-262d-47b1-9b48-fc19d8e3db87">
<File Id="Scripts_jquery.signalR_2.2.1.min.js" Name="jquery.signalR-2.2.1.min.js" Source="$(var.WixSetup2_TargetDir)Scripts\jquery.signalR-2.2.1.min.js" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
It would be great if you can help me to get rid of this issue.
You have set the condition to run only if the product already installed.
Change the condition in the custom action to Not installed.
<Custom Action="addPort" Before="InstallExecute">NOT Installed</Custom>

Unresolved reference to symbol 'WixComponentGroup:MyWebWebComponents' in section

I was following the below code which is product.wxs files.But I am facing an error as below:
Error 5 Unresolved reference to symbol 'WixComponentGroup:MyWebWebComponents' in section 'Product:{}'
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">
<Product Id="702881b5-9a64-4ab8-ab47-f3babcd950a2"
Name="WixApplication" Language="1033"
Version="1.0.0.0"
Manufacturer="HexWireless"
UpgradeCode="42b7872b-78c8-4a0b-abcd-28a30c9804ab">
<Package InstallerVersion="200" Compressed="yes" Platform="x64" InstallScope="perMachine"/>
<!--<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />-->
<!--Find the Path to the sqlcmd.exe by performing a registry search. This is hardcoded for SQL 2012.
Change 110 to 100 for 2008. Might need to change the script too.-->
<Property Id="SQLBINDIR">
<RegistrySearch Id="SqlBinDir"
Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server\110\Tools\ClientSetup"
Name="Path"
Type="raw"
Win64="yes"/>
</Property>
<Condition Message="Microsoft SQL Server 2012 needs to be installed before this installer can run">
<![CDATA[SQLBINDIR]]>
</Condition>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLLOCATION" Name="Database">
<Component Id="Database" Guid="a8dc2Fcd-087d-e393-b059-c67877e51b8a">
<File Id="DatabaseScript" Source="SQLScripts\HexWireless.sql"/>
<RemoveFile Id ="RemoveInstall.log" Name="Install.log" On="uninstall" />
</Component>
</Directory>
<Directory Id="INSTALLDIR" Name="PFiles">
<Directory Id="WixService" Name="Service">
<Component Id="WixWindowsServiceComponent" DiskId="1" Guid="6f51c0f3-776c-4aec-a200-1f199352c6c3" Win64="yes">
<File Id="WixService.exe" Name="WixService.exe" Source="$(var.WixService.TargetDir)\WixService.exe"/>
<ServiceInstall Id="InstallWixService" DisplayName="WixService" Name="WixService.exe" Description="WixService" Account="NT Authority\Network Service" ErrorControl="normal" Start="demand" Type="ownProcess" Vital="yes" />
<ServiceControl Id="ControlWixService" Name="WixService.exe" Stop="uninstall" Remove="uninstall" />
</Component>
</Directory>
</Directory>
<Directory Id="INSTALLFOLDER" Name="Publish">
</Directory>
</Directory>
<Feature Id="ProductFeature" Title="WebApplication" Level="1">
<Feature Id="Database" Title="Database" Description="DatabaseScript" Level="1" Display="expand"
AllowAdvertise="no" ConfigurableDirectory="INSTALLLOCATION" Absent="allow">
<Feature Id="WixWindowsServiceComponent" Title="Service" Description="WixService" Level="1" Display="expand"
AllowAdvertise="no" ConfigurableDirectory="INSTALLDIR" Absent="allow">
<ComponentGroupRef Id="WixWebsiteIssConfiguration" />
<ComponentRef Id="Database"/>
<ComponentRef Id="WixWindowsServiceComponent"/>
<ComponentGroupRef Id="MyWebWebComponents"/>
</Feature>
</Feature>
</Feature>
<Property Id="INSTALLDIR" Value="D:" />
<Media Id="1" Cabinet="WixWindowsServiceComponent.cab" EmbedCab="yes" />
<InstallExecuteSequence>
<!--If the database feature is selected these actions will run to install the DB-->
<Custom Action="Database.cmd" After="InstallFiles" >
<![CDATA[NOT Installed]]>
</Custom>
<!--Ensure this runs after the custom action to set up the properties for its cmd line-->
<Custom Action="Database" After="Database.cmd">
<![CDATA[NOT Installed]]>
</Custom>
</InstallExecuteSequence>
<UI>
<UIRef Id="GUI"/>
<UIRef Id="WixUI_ErrorProgressText" />
</UI>
<!--This is the sequence script. Best way to understand this is by running sqlcmd -?
Use "property" Custom action to get variable substitution working-->
<CustomAction Id="Database.cmd" Property="Database"
Value=""[SQLBINDIR]sqlcmd.exe" -E -S "[SQLSERVER]" -i "[#DatabaseScript]" -o "[INSTALLLOCATION]HexWireless.log""/>
<!-- Note that the cmd line and args will come from a property with the same name as the custom action, this has been set by the custom action above -->
<CustomAction Id="Database" BinaryKey="WixCA" DllEntry="CAQuietExec" Return="check" Execute="deferred" Impersonate="yes" />
</Product>
</Wix>
Thanks In Advance.
I am not sure if your issue is sorted or not, I just faced the same issue even though i have created a few of these msi files with Wix.
In my case, it wasn't finding the "HeatedComponents" that I am generating automatically within the project. I had to load this file into the project, (these files or folders may be inside your project folder but in most cases VS does not load them automatically).
You have to Right Click on the project -> Add -> Existing Item; and select the file/item that is required.

WIX installer how do remove install

I created a basic installer.
It takes a file from c:\temp.log and copy it to a directory that is being read from registry.
Where is the un-installer ? How does it add link to Windows "Add remove programs" ?
What am i missing here?
On install i need to copy the file and then to stop/start a certain service.
On Un-install i need to remove that file+folder and then to stop/start a certain service.
Thanks
Code:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="325c4bfd-6614-43e9-aedb-93661295352d" Name="install" Language="1033" Version="1.0.0.0" Manufacturer="install" UpgradeCode="4307526e-3902-40d0-991b-bacff9b3d71b">
<Package InstallerVersion="200" Compressed="yes" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<Property Id="APPDIR">
<RegistrySearch Id="APPDIRECTORY" Type="raw" Root="HKLM" Key="SOFTWARE\APP\APPInstalPath" Name="InstallationPath" />
</Property>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="APPDIR">
<Component Id="ProductComponent" Guid="93118c45-f0c0-4c9e-9168-8ea905e9427c">
<File Id="pluggin" Source="C://setup.log" KeyPath="yes" Checksum="yes"/>
</Component>
</Directory>
</Directory>
<Feature Id="ProductFeature" Title="install" Level="1">
<ComponentRef Id="ProductComponent" />
<ComponentGroupRef Id="Product.Generated" />
</Feature>
</Product>
</Wix>
The listing in Add/Remove programs is whatever Name you specified in the Product tag. In your case, the name in Add/Remove programs is install:
<Product Id="325c4bfd-6614-43e9-aedb-93661295352d" Name="install"

WiX not embedding binaries

I'm using WiX to create my products installer. For some reason it's no longer embedding the .exes and .dlls inside the installer. So I have this:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="USERSPECIFIEDDIR" Name="My-app-name" />
</Directory>
and it creates a .msi alongside a folder called My-app-name that contains all .exe and dll files required for the application. if i run the installer from there, it's alright, but if i move the msi elsewhere (without the subdirectory), it errors out because it can't find the files. how can i tell WiX to embed all binaries inside the installer??
in case it helps, here are some other snippets from my wxs. let me know if you need any other information. oh, and i'm using wix directly from visual studio 2008.
<DirectoryRef Id="USERSPECIFIEDDIR">
<Component Id="MainExe" Guid="580F8F15-C06C-49A7-ADDC-56C96580DC0D">
<File Id="MainExe" Name="OrderMonkey.exe" KeyPath="yes" />
</Component>
<Component Id="OMEmailerExe" Guid="3B0AECC3-67E5-40B3-83CB-9B84FE965ED8">
<File Id="OMEmailerExe" Name="OMEmailer.exe" />
</Component>
<Component Id="migradomDLL" Guid="37E1BCAE-EB39-4DF5-88C7-AE74CA5EA171">
<File Id="migradom" Name="MigraDoc.DocumentObjectModel.dll" />
</Component>
<Component Id="migrarenderDLL" Guid="C2910B9E-0B06-467A-853C-7651BE7BD9E4">
<File Id="migrarender" Name="MigraDoc.Rendering.dll" />
</Component>
<Component Id="migrartfDLL" Guid="CEBE4DE9-7CA0-4F48-A8B1-1D46E4E48B66">
<File Id="migrartf" Name="MigraDoc.RtfRendering.dll" />
</Component>
<Component Id="mysqldataDLL" Guid="2E474737-474C-4146-8E67-D3837B5DB862">
<File Id="mysqldata" Name="MySql.Data.dll" />
</Component>
<Component Id="pdfchartingDLL" Guid="7467B6C2-BE38-4283-B179-9FA94C4A087F">
<File Id="pdfcharting" Name="PdfSharp.Charting.dll" />
</Component>
<Component Id="pdfsharpDLL" Guid="39F23E36-BF9C-40C1-8190-6A3554B879BC">
<File Id="pdfsharp" Name="PdfSharp.dll" />
</Component>
<Component Id="sqliteDLL" Guid="B043CF20-8DC2-4A10-AE4B-4721263A111E">
<File Id="sqlite" Name="System.Data.SQLite.dll" KeyPath="yes" />
</Component>
</DirectoryRef>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="414E91FD-7410-492C-9D48-8125C6ECCF0B">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="Order Monkey"
Description="Order Monkey Orders and Quotes"
Target="[USERSPECIFIEDDIR]OrderMonkey.exe"
WorkingDirectory="USERSPECIFIEDDIR" />
<Shortcut Id="ApplicationOfflineStartMenuShortcut"
Name="Order Monkey Offline"
Description="Order Monkey Orders and Quotes"
Target="[USERSPECIFIEDDIR]OrderMonkey.exe"
WorkingDirectory="USERSPECIFIEDDIR"
Arguments="-offline" />
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Microsoft\OrderMonkey" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<Feature Id='Complete' Level='1' Title='Order Monkey Complete' Description='The complete package' ConfigurableDirectory='TARGETDIR' Display='expand'>
<ComponentRef Id='MainExe' />
<ComponentRef Id='OMEmailerExe' />
<ComponentRef Id='migradomDLL' />
<ComponentRef Id='migrarenderDLL' />
<ComponentRef Id='migrartfDLL' />
<ComponentRef Id='mysqldataDLL' />
<ComponentRef Id='pdfchartingDLL' />
<ComponentRef Id='pdfsharpDLL' />
<ComponentRef Id='sqliteDLL' />
<ComponentRef Id='ApplicationShortcut' />
<ComponentRef Id='AppData' />
</Feature>
Use these elements:
<Package Compressed="yes" InstallScope="perMachine" />
<MediaTemplate EmbedCab="yes" />
Package/#Compressed="yes" creates cabinets instead of loose files. MediaTemplate/#EmbedCab="yes" embeds the default cabinets into the .msi.

Resources