WIX Single Package Installer - Per machine Shortcuts - wix

I followed this for getting a functioning Per-User/Per-machine installer working using ALLUSERS=2. Now, my issue is regarding getting shortcuts working properly with this setup. If I set MSIINSTALLPERUSER=1 (Single User) then my Desktop and StartMenu shortcuts are always added per user in the HKCU. If I set MSIINSTALLPERUSER={}, then I can get shortcuts per machine. In the custom UI, MSIINSTALLPERUSER is being set based on the selected radio button in the advanced portion of the UI. So, although the shortcuts are created last and their registry values are set to HKMU, the installer always chooses where to put the shortcuts based on the initial value of MSIINSTALLPERUSER.
Can anyone point me in the right direction to properly creating shortcuts based on the type of install selected in the advanced UI (Per User / Per Machine).
Here is my Product.wxs
`
<?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="HearCon" Language="1033" Version="2.0.299" Manufacturer="Tremetrics" UpgradeCode="73765816-7ba9-4a2b-89c3-ce1f26863b53">
<Package InstallerVersion="500" Compressed="yes" />
<MediaTemplate EmbedCab="yes" />
<Condition Message="Only Windows 7 and newer are supported">
<![CDATA[Installed OR VersionNT >= 601]]>
</Condition>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<Feature Id="ProductFeature" Title="Application" Level="1">
<ComponentGroupRef Id="HearConGroup" />
<ComponentRef Id="RA660Folder_Permission" />
</Feature>
<Feature Id="DesktopShortcutFeature" Title="Desktop Shortcut" Level="1">
<ComponentRef Id="DesktopShortcut" />
</Feature>
<Feature Id="StartMenuShortcutFeature" Title="Start Menu Shortcut">
<ComponentRef Id="ProgramMenuShortcut" />
<Condition Level="1">Privileged</Condition>
</Feature>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="APPLICATIONFOLDER" Name="HearCon" />
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
<Directory Id="ProgramMenuFolder" />
<Directory Id="CommonAppDataFolder">
<Directory Id="RA660Folder" Name="RA660">
<Directory Id="RA660Driver" Name="Drivers" />
</Directory>
</Directory>
</Directory>
<Property Id="WixAppFolder" Value="WixPerUserFolder" />
<Property Id="ApplicationFolderName" Value="HearCon" />
<Property Id="ALLUSERS" Value="2" />
<Property Id="DISABLEADVTSHORTCUTS" Value="1" />
<Property Id="MSIINSTALLPERUSER" Value="1" />
<UIRef Id="WixUI_CustomAdvanced" />
<WixVariable Id="WixUIBannerBmp" Value="HearConBanner.bmp" />
</Product>
<Fragment>
<DirectoryRef Id="DesktopFolder">
<Component Id="DesktopShortcut" Guid="10E3E42D-8B2E-471D-A6F9-6263C3491D4C">
<RegistryValue Root="HKMU" Key="Software\Tremetrics\HearCon" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="ProgramMenuFolder">
<Component Id="ProgramMenuShortcut" Guid="2C7EA878-B1B1-4B64-937A-6B583ED5E9B3">
<RegistryValue Root="HKMU" Key="Software\Tremetrics\HearCon" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="RA660Folder">
<Component Id="RA660Folder_Permission" Guid="0A538414-E53F-470E-9546-7EF193878F05">
<CreateFolder>
<util:PermissionEx User="Users" GenericAll="yes"/>
</CreateFolder>
</Component>
</DirectoryRef>
</Fragment>
</Wix>
`

Related

unable to remove the desktop icon after uninstallation in WIX

I am using WIX installer for my application everything working fine but when I uninstall the application the desktop icon and startmenu icon is still there.
Whats wrong with my xml. followed the steps given by Wix documentation.
help..
XML:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="applicationName" Language="1033" Version="1.0.0.0" Manufacturer="manufacturerName" UpgradeCode="PUT-GUID-HERE">
<Package Id="*" InstallerVersion="201" Compressed="yes" InstallScope="perMachine" Comments="Windows Installer Package" ReadOnly="yes" InstallPrivileges="elevated" />
<Feature Id="ProductFeature" Title="applicationName" Level="1">
<ComponentRef Id="Permission.INSTALLFOLDER" />
<ComponentRef Id="ApplicationDeskShortcutComp" />
<ComponentGroupRef Id="HeatGenerated" />
</Feature>
<Media Id="1" Cabinet="cab1.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="CompanyNameFolder" Name="CompanyName">
<Directory Id="INSTALLFOLDER" Name="applicationName">
<Component Id="Permission.INSTALLFOLDER" Guid="*">
<CreateFolder>
<Permission User="Everyone" GenericAll="yes" />
</CreateFolder>
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="DesktopFolder" Name="applicationName" />
</Directory>
</DirectoryRef>-->
<!--Add the shortcut to installer package For DeskTop-->
<DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationDeskShortcutComp" Guid="*" Win64="yes" >
<Shortcut Id="ApplicationDeskShortcut" Name="applicationName" Description="applicationName" Target="[INSTALLFOLDER]exeName.exe" WorkingDirectory="DesktopFolder" Icon="IconName.exe" >
</Shortcut>
<RemoveFolder Id="DesktopFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\Manufacturer\ProductName" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
<Property Id="MYWIXUI_MONDO" Value="INSTALLFOLDER" />
<UIRef Id="MyWixUI_Mondo" />
<Icon Id="IconName.exe" SourceFile=".\Icons\MainLogo.ico" />
<Property Id="ARPPRODUCTICON" Value="IconName.exe" />
</Wix>
No time to test this right now, but could you first please try to change this:
<Directory Id="DesktopFolder" Name="applicationName" />
into this:
<Directory Id="DesktopFolder" />
DesktopFolder is a built-in Windows Installer folder that should resolve to the user's desktop folder or the common desktop folder for all users depending on the setting for ALLUSERS (per-machine or per-user installation).
During installation, MSI directory resolution (costing) will assign the correct value to DesktopFolder for the system you are running on (based on ALLUSERS setting). I thought anything you assign to DesktopFolder yourself in your WiX source would be wiped out as soon as directory resolution has run, so there is no direct logical reason why the above WiX markup change suggestion should work, but I think it should be tested. Please test on a clean virtual, if available.

how to set registry value in wix?

I am trying to set the registry value for my installation location in my WiX.
I want to set the key in localmachine/software
so I used the following WiX file. I am not getting any build error, everything is going right but the registry value is not set.
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define engage.client.app_TargetDir=$(var.engage.client.app.TargetDir)?>
<Product Id="*" Name="EngageSetupCreator" Language="1033" Version="1.0.0.0" Manufacturer="KrimzenInc" UpgradeCode="PUT-GUID-HERE">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" AdminImage="yes" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="EngageSetupCreator" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="ProductComponents2" />
<ComponentRef Id="InstallRegistryComponent"/>
<!--<ComponentGroupRef Id="Assets"/>-->
</Feature>
</Product>
<Fragment>
<SetDirectory Id="INSTALLFOLDER" Value="[WindowsVolume]Engage" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="WINDOWSVOLUME">
<Directory Id="SUB_FOLDER" Name="Engage">
<Directory Id="INSTALLFOLDER" Name="EngageSetupCreator" >
<Component Id="InstallRegistryComponent" Guid="*">
<RegistryKey Id='ChessInfoBarInstallDir' Root='HKLM' Key='Software\Crimson\Engage' Action='createAndRemoveOnUninstall' >
<RegistryValue Type='string' Name='InstallDir' Value="[INSTALLFOLDER]" Action="write" KeyPath="yes" />
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="engage.client.app.exe" Guid="*">
<File Id="engage.client.app.exe" Name="engage.client.app.exe" Source="$(var.engage.client.app_TargetDir)engage.client.app.exe" />
</Component>
<Component Id="CefSharp.BrowserSubprocess.exe" Guid="*">
<File Id="CefSharp.BrowserSubprocess.exe" Name="CefSharp.BrowserSubprocess.exe" Source="$(var.engage.client.app_TargetDir)CefSharp.BrowserSubprocess.exe" />
</Component>
</ComponentGroup>-->
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch KrimzenEngage" />
<!-- Step 3: Include the custom action -->
<Property Id="WixShellExecTarget" Value="[#engage.client.app.exe]" />
<CustomAction Id="LaunchApplication"
BinaryKey="WixCA"
DllEntry="WixShellExec"
Impersonate="yes" />
</Fragment>
</Wix>
but its not setting the value.
what iam doing wrong? I am running this in 64bit system.
On 64-bit systems, 32-bit software registry keys normally found in "HKLM\Software\ExampleSoftware" are instead found in "HKLM\Software\WOW6432Node\ExampleSoftware". Check here for more information.

Why file get overwritten when KeyPath is set in Wix

The snippet of Files.wxs generated by heat:
<?xml version="1.0" encoding="utf-8"?>
<Wix
xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<Directory Id="dirF5D9BDF13CBC346EDDFD6D0959FFB838" Name="config">
<Component Id="cmp0CBEDCE6B62E5666B3362D0EB41267BC" Guid="*">
<File Id="fil73D1987B7864F07C97735D7E40243AB2" KeyPath="yes"
Source="$(var.App.TargetDir)\config\accounts-example.ini" />
</Component>
</Component>
</Directory>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="Binaries">
<ComponentRef Id="cmp0CBEDCE6B62E5666B3362D0EB41267BC" />
</ComponentGroup>
</Fragment>
</Wix>
Product.wxs:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Product Id="*" Name="xxx" Language="2052" Version="$(var.ProductVersion)" Manufacturer="xxx"
UpgradeCode="425BDA6F-31B8-47AD-88D8-4B2DBE394XXX">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="New Version [ProductName] has been installed。" />
<MediaTemplate EmbedCab="yes" />
<WixVariable Id="WixUILicenseRtf" Value="./License.rtf" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="MANUFACTURERFOLDER" Name="!(bind.property.Manufacturer)">
<Directory Id="INSTALLFOLDER" Name="!(bind.property.ProductName)" />
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="!(bind.property.ProductName)" />
<Directory Id="DesktopFolder" Name="Desktop" />
</Directory>
</Directory>
<Feature Id="ProductFeature" Title="XXX_Installer" Level="1">
<ComponentGroupRef Id="Binaries" />
<ComponentRef Id="ApplicationShortcut" />
<ComponentRef Id="ApplicationShortcutDesktop" />
<ComponentRef Id="RegistryEntries" />
</Feature>
<UIRef Id="WixUI_ErrorProgressText" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<UIRef Id="WixUI_InstallDir" />
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="E1F61345-CC60-40FE-8FC4-FBE1598F8XXX">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="!(bind.property.ProductName)"
Description="!(bind.property.ProductName)"
Target="[INSTALLFOLDER]XXX_App.exe"
WorkingDirectory="INSTALLFOLDER" />
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\Microsoft\!(bind.property.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
<DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationShortcutDesktop" Guid="BEDF111F-0889-4317-8E67-41425F00CXXX">
<Shortcut Id="ApplicationDesktopShortcut"
Name="!(bind.property.ProductName)"
Description="!(bind.property.ProductName)"
Target="[INSTALLFOLDER]XXX_App.exe"
WorkingDirectory="INSTALLFOLDER" />
<RemoveFolder Id="DesktopFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\Microsoft\!(bind.property.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
<DirectoryRef Id="TARGETDIR">
<Component Id="RegistryEntries" Guid="0D919675-E219-43EA-AAB3-E6F81A013XXX">
<RegistryKey Root="HKCU"
Key="Software\Microsoft\Windows\CurrentVersion\Run">
<RegistryValue Name="!(bind.property.ProductName)"
Type="string"
Value="[INSTALLFOLDER]XXX_App.exe"/>
</RegistryKey>
</Component>
</DirectoryRef>
<UI>
<Publish Dialog="ExitDialog"
Control="Finish"
Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="启动!(bind.property.ProductName)" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
<Property Id="WixShellExecTarget" Value="[INSTALLFOLDER]XXX_App.exe" />
<CustomAction Id="LaunchApplication"
BinaryKey="WixCA"
DllEntry="WixShellExec"
Impersonate="yes" />
</Product>
</Wix>
Every time I install a new version, it overwrites the existing file accounts-example.ini.
The overwrite behavior is expected for accounts-example.ini, but I will have another file user.db do not want to be overwritten.
It says if KeyPath is set to 'yes' then it doesn't overwrite the existing file, isn't it? How could I config Wix to overwrite one file and not overwirte another?
Some articles about KeyPath:
what-is-the-wix-keypath-attribute
copy-if-not-exist-in-wix
If you are doing this with a majorupgrade element you need to tell us where it's scheduled. If it's "early" (such as afterInstallInitialize) then everything will be uninstalled first, and then the new upgrade installed, and every file that was installed will be from the new upgrade. If it's sequenced "late" (such as afterInstallExecute) then the overwrite rules apply (such as this https://msdn.microsoft.com/en-us/library/windows/desktop) and that's because the upgrade basically installs each file over the existing files.
Note that the WiX default for the MajorUpgrade schedule is afterInstallValidate, so as I described (and as the WiX documentation says) the entire older product will be uninstalled first (obviously removing all files) then all the new files will be installed.
See schedule here:
http://wixtoolset.org/documentation/manual/v3/xsd/wix/majorupgrade.html
The explanation at the WiX keypath link leaves a lot to be desired. It is not really true to say that if the component is present none of its resources will be installed. It's not clear to me what that is intended to mean because the overwrite rules will be applied.
As far as your data files are concerned, they will not be overwritten by an incoming file if they have been updated since they were installed. So it's likely that your ini file is being overwritten because it hasn't been changed. If your db has been updated then it won't be replaced, but, again, this is overwrite rules when your major upgrade is "late" (or it's a patch).

How to install .net 4.5 from web installer using wix

first time using Wix so sorry if my question appears dumb. i have had a look around here for my answer and it appears I need to use a bundle.
I have my main wxs page with all my registry, files DB to install but how do I include a bundle within this file? I have this:
<?xml version="1.0" encoding="UTF-8"?>
<Wix
xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension"
xmlns:ui="http://schemas.microsoft.com/wix/UIExtension" >
<Bundle>
</Bundle>
<Product Id="*" Name="IMy Application Name" Language="1033" Version="2.0.0.0" Manufacturer="My Company Name" UpgradeCode="5d4e4839-11b8-403c-a440-796507b2f057">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" />
<MajorUpgrade
AllowDowngrades="no"
AllowSameVersionUpgrades="no"
IgnoreRemoveFailure="no"
DowngradeErrorMessage="loc.NewerVersionInstalled"
Schedule="afterInstallInitialize"/>
ERRORS FROM HERE!
<Bundle Name="Prog" Version="1.0.0.0" Manufacturer="my Corporation" UpgradeCode="*">
<Chain>
<PackageGroupRef Id="Netfx45FullPackage" />
</Chain>
</Bundle>
<Fragment>
<PackageGroup Id="Netfx45FullPackage">
<ExePackage Id="Netfx45Xxx" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="no" InstallCommand="/q" SourceFile="..\SetupProject\dotnetfx45_full_x86_x64.exe" DetectCondition="(Netfx4FullVersion="4.5.50709") AND (NOT VersionNT64 OR (Netfx4x64FullVersion="4.5.50709"))" InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0) AND (NOT (Netfx4FullVersion="4.5.50709" OR Netfx4x64FullVersion="4.5.50709"))" />
TO HERE!
<MsiPackage Id="MyProg" Cache="no" Compressed="no" DisplayInternalUI="yes" Vital="yes" SourceFile="$(var.installerPath)\MyProgCore.msi" />
</PackageGroup>
</Fragment>**
<InstallUISequence>
<Custom Action='PreventDowngrading' After='FindRelatedProducts'>NEWPRODUCTFOUND</Custom>
</InstallUISequence>
<CustomAction Id='PreventDowngrading' Error='Newer version already installed' />
<Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONROOTDIRECTORY" />
<UI>
<UIRef Id="WixUI_Minimal" />
<Publish
Dialog="ExitDialog"
Control="Finish"
Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed
</Publish>
</UI>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch My Application" />
<Property Id="WixShellExecTarget" Value="[#InformedWorker]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<MediaTemplate EmbedCab="yes"/>
<PropertyRef Id="NETFRAMEWORK45"/>
<Condition Message="This application requires .NET Framework 4.5. Please install the .NET Framework then run this installer again.">
<![CDATA[Installed OR NETFRAMEWORK20]]>
</Condition>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="Informed Worker"/>
<Directory Id="OriginalFilesFolder" Name="OriginalFiles" SourceName="SourceFiles"/>
<Directory Id="CopiedFilesFolder" Name="My Application Name" />
</Directory>
<Directory Id="CommonAppDataFolder">
<Directory Id="ConfigFOLDER" Name="My Application Name">
<Directory Id="EmptyDataFolderDir" Name="Data" />
<Directory Id="EmptyLogFolderDir" Name="Log" />
<Directory Id="RegComponents" Name="Reg" />
</Directory>
</Directory>
<!-- Step 1: Define the directory structure -->
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="My Application Name"/>
<Directory Id="DesktopFolder" Name="Desktop"></Directory>
</Directory>
</Directory>
<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
<Component Id="InformedWorker" Guid="*">
<File Id="InformedWorker" Source="SourceFiles\MyApp.exe" KeyPath="yes" Checksum="yes"/>
</Component>
</DirectoryRef>
<Feature Id="MainApplication" Title="Main Application" Level="1">
<ComponentRef Id="MyApp" />
</Feature>
<Feature Id="ProductFeature" Title="Setup" Level="1">
<ComponentGroupRef Id="DataFolderComponent" />
<ComponentGroupRef Id="LogFolderComponent" />
<ComponentGroupRef Id="RegComponents" />
<ComponentGroupRef Id="FilesFolder" />
<ComponentGroupRef Id="DBFolder" />
</Feature>
<Icon Id="InformedWorker" SourceFile="SourceFiles\MyApp.exe" />
<Property Id="ARPPRODUCTICON" Value="My Application Name" />
</Product>
<Fragment>
<ComponentGroup Id="DataFolderComponent" Directory="EmptyDataFolderDir">
<Component Id="CMP_MyEmptyDataDir" Guid="85DAD4AE-6404-4A40-B713-43538091B9D3" KeyPath="yes">
<CreateFolder />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="LogFolderComponent" Directory="EmptyLogFolderDir">
<Component Id="CMP_MyEmptyLogDir" Guid="a4594ec9-3101-4627-8ee7-d60d0a9b1f63" KeyPath="yes">
<CreateFolder />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="RegComponents" Directory="APPLICATIONROOTDIRECTORY">
<Component Id="RegistryEntries" Guid="9AB04D89-19B5-4729-9CD5-656C8C6B833F">
<RegistryKey Root="HKCR" Key="My Application Name">
<RegistryValue Type="string" Name="ClientRef" Value=""/>
</RegistryKey>
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="FilesFolder" Directory="OriginalFilesFolder">
<Component Id="EXE_File" Guid="*">
<File Id="AppExe" Source="SourceFiles\MyApp.exe" KeyPath="yes">
<CopyFile Id="Copy_EXE" DestinationDirectory="APPLICATIONROOTDIRECTORY" DestinationName="MyApp.exe" />
</File>
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="DBFolder" Directory="OriginalFilesFolder">
<Component Id="DB_File" Guid="a4eeb7a3-635c-41c3-b8c8-35c9c4f46d97">
<File Id="AppDB" Source="SourceFiles\Data.db3" KeyPath="yes">
<CopyFile Id="Copy_DB" DestinationDirectory="EmptyDataFolderDir" DestinationName="MyDB.db3" />
</File>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
But it does not like the inclusion of my bundle..?
Bundles are separate projects. One project for your MSI and one for your bundle.

WIX Create All Users Shortcut without Registry Key

I have a WIX file which i'm using to to install an app and create two short cuts. One in all users start menu and one in the desktop.
Since it creates it's stuff in all users I thought that you didn't need to have a reg key.
But without it it complains.
with
error LGHT0204: ICE38: Component ProgramMenuAppFolder installs to user profile. It must use a registry key under HKCU as its KeyPath, not a file.
With HKLM however it also complains that the
LGHT0204: ICE38: Component ProgramMenuAppFolder installs to user profile. It's KeyPath registry key must fall under HKCU.
Even though it's installing to the all users and so shouldn't be installing to the user profile.
Any suggestions?
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Product Id="*" Name="$(var.PublisherSimple) $(var.AppName)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="$(var.Publisher)" UpgradeCode="$(var.ProductUpgradeCode)">
<Package
Description="$(var.PublisherSimple) $(var.AppName) $(var.ProductVersion)"
InstallerVersion="200" Compressed="yes"
InstallScope="perMachine"
/>
<Property Id="DISABLEADVTSHORTCUTS" Value="1" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate CompressionLevel="none" />
<Feature Id="ProductFeature" Title="$(var.PublisherSimple) $(var.AppName) $(var.ProductVersion)" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id="ProgramMenuDir"/>
<ComponentRef Id="ProgramMenuAppFolder"/>
</Feature>
<UI>
<UIRef Id="WixUI_InstallDir" /> <!-- actually uses but that just skips the licence page <UIRef Id="WixUI_InstallDir_Custom" />-->
<Publish Dialog="ExitDialog"
Control="Finish"
Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<!--<Property Id="WixAppFolder" Value="WixPerMachineFolder" />-->
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch $(var.AppName)" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
<Property Id="WixShellExecTarget" Value="[#MVTestApp.exe]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="PublisherDirectory" Name="MV">
<Directory Id="INSTALLFOLDER" Name="MV Test App"/>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuDir" Name="MV" >
<Directory Id="ProgramMenuAppFolder" Name="MV Test App Folder">
<Component Id="ProgramMenuAppFolder" Guid="3ebfd81d-08b2-4bcf-8c90-e84241a58976">
<RemoveFolder Id="ProgramMenuAppFolder" On="uninstall" />
<!--<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Value="" KeyPath="yes" />-->
</Component>
</Directory>
<Component Id="ProgramMenuDir" Guid="f1cf94bf-5e5a-4c60-8729-65bdf1cb9244">
<RemoveFolder Id="ProgramMenuDir" On="uninstall" />
<!--<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]Start" Type="string" Value="" KeyPath="yes" />-->
</Component>
</Directory>
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents">
<Component Id="MVTestApp.Exe" Directory="INSTALLFOLDER" Guid="*" Win64="no">
<File Id="MVTestApp.Exe" KeyPath="yes" Source="MVTestApp.Exe" />
<Shortcut Id="startmenuShortCut" Directory="ProgramMenuAppFolder" Name="MV Test App Short Start" WorkingDirectory="INSTALLFOLDER" Advertise="yes" />
<Shortcut Id="desktopShortCut" Directory="DesktopFolder" Name="MV Test App Short Desk" WorkingDirectory="INSTALLFOLDER" Advertise="yes" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
This is a similar problem as Install optional desktop shortcut for all users