I try to run my first WIX project. This is the wxs file:
<?xml version='1.0' encoding='utf-8'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product Name='Foobar 1.0' Manufacturer='Acme Ltd.'
Id='E45C8A57-FA6B-492F-A5AC-FCC8545DE419'
UpgradeCode='716019A7-E215-4253-AA0F-910A2BD09D73'
Language='1033' Codepage='1252' Version='1.0.0'>
<Package Id='*' Keywords='Installer' Description="Acme's Foobar 1.0 Installer"
Comments='Foobar is a registered trademark of Acme Ltd.' Manufacturer='Acme Ltd.'
InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
<Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt='CD-ROM #1' />
<Property Id='DiskPrompt' Value="Acme's Foobar 1.0 Installation [1]" />
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='Acme' Name='Acme'>
<Directory Id='INSTALLDIR' Name='Foobar 1.0'>
<Component Id='MainExecutable' Guid='E7011577-EE28-41D9-8F4F-2C924BE1F1E0'>
<File Id='FoobarEXE' Name='FoobarAppl10.exe' DiskId='1' Source='FoobarAppl10.exe' KeyPath='yes'>
<Shortcut Id="startmenuFoobar10" Directory="ProgramMenuDir" Name="Foobar 1.0"
WorkingDirectory='INSTALLDIR' Icon="Foobar10.exe" IconIndex="0" Advertise="yes" />
<Shortcut Id="desktopFoobar10" Directory="DesktopFolder" Name="Foobar 1.0"
WorkingDirectory='INSTALLDIR' Icon="Foobar10.exe" IconIndex="0" Advertise="yes" />
</File>
</Component>
<Component Id='HelperLibrary' Guid='038B28E3-14F1-4C19-A1D2-973ACC3E7465'>
<File Id='HelperDLL' Name='Helper.dll' DiskId='1' Source='Helper.dll' KeyPath='yes' />
</Component>
<Component Id='Manual' Guid='778FFF81-3714-47EE-B855-A191F9C59061'>
<File Id='Manual' Name='Manual.pdf' DiskId='1' Source='Manual.pdf' KeyPath='yes'>
<Shortcut Id='startmenuManual' Directory='ProgramMenuDir' Name='Instruction Manual' Advertise='yes' />
</File>
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuDir" Name="Foobar 1.0">
<Component Id="ProgramMenuDir" Guid="BE847EEE-8AF3-41E5-B422-60534B0977C1">
<RemoveFolder Id='ProgramMenuDir' On='uninstall' />
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
</Component>
</Directory>
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
</Directory>
</Product>
</Wix>
Then I run from the commandline candle.exe myapp.wxs successfully it creates the wixobj-file myapp.wixobj.
But when running light.exe myapp.wixobj the light.exe hangs.
I have read in an other ticket that a solution would be to add the MSBuild argument. /p:RunWixToolsOutOfProc=true. But how can I do this from commandline ?
Related
What RegistryValue Root should be used in case of Single Package Authoring installation?
This is a simple Single Package Authoring installation:
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product Name='Foobar 1.0' Id='GUID' UpgradeCode='GUID'
Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='Acme Ltd.'>
<Package Id='*' Keywords='Installer' Description="Acme's Foobar 1.0 Installer"
Comments='Foobar is a registered trademark of Acme Ltd.' Manufacturer='Acme Ltd.'
InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
<Property Id="ALLUSERS" Secure="yes" Value="2" />
<Property Id="MSIINSTALLPERUSER" Secure="yes" Value="1" />
<Property Id='ApplicationFolderName' Value="Acme" />
<Property Id='WixAppFolder' Value="WixPerUserFolder" />
<Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
<Property Id='DiskPrompt' Value="Acme's Foobar 1.0 Installation [1]" />
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='Acme' Name='Acme'>
<Directory Id='INSTALLDIR' Name='Foobar 1.0'>
<Component Id='MainExecutable' Guid='GUID'>
<File Id='FoobarEXE' Name='FoobarAppl10.exe' DiskId='1' Source='FoobarAppl10.exe' KeyPath='yes'>
<Shortcut Id="startmenuFoobar10" Directory="ProgramMenuDir" Name="Foobar 1.0" WorkingDirectory='INSTALLDIR' Icon="Foobar10.exe" IconIndex="0" Advertise="yes" />
</File>
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuDir" Name="Foobar 1.0">
<Component Id="ProgramMenuDir" Guid="GUID">
<RemoveFolder Id='ProgramMenuDir' On='uninstall' />
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id='Complete' Title='Foobar 1.0' Description='The complete package.'
Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR'>
<Feature Id='MainProgram' Title='Program' Description='The main executable.' Level='1'>
<ComponentRef Id='MainExecutable' />
<ComponentRef Id='ProgramMenuDir' />
</Feature>
</Feature>
<Icon Id="Foobar10.exe" SourceFile="FoobarAppl10.exe" />
<UI Id="MyWixUI_Mondo">
<UIRef Id="WixUI_MySetup" />
</UI>
</Product>
</Wix>
During installation registry key 'Software[Manufacturer][ProductName]' will be created under HKCU root.
It is correct in case of per user installation.
But I am not sure that it is correct in case of per machine installation.
It is impossible to use HKLM instead of HKCU - wix will not compile such a file.
There is the error "ICE38: Component ProgramMenuDir installs to user profile. It's KeyPath registry key must fall under HKCU" during compilation.
Is it a problem?
Or should I use HKCU in case of per user and per machine installations if I use Single Package Authoring installation?
Windows Installer XML uses the root type "HKMU" to the MSI type "(none)" (-1). See: Registry Table
(none) - 0x001 -1 If this is a per-user installation, the registry
value is written under HKEY_CURRENT_USER. If this is a per-machine
installation, the registry value is written under HKEY_LOCAL_MACHINE.
Note that a per-machine installation is specified by setting the
ALLUSERS property to 1.
I'm struggling on creating a desktop-shortcut depending on the chosen feature(s) within the WiX-Installer. If I run the installer, no shortcut is appearing. Is doesn't matter if only one feature is chosen or both. Are there any ideas out there?
<?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="XXX" Name="MyProduct" Language="1031" Codepage="1252" Version="4.4.0" Manufacturer="MyCompany" UpgradeCode="XXX">
<Package Description="MyProductDescription" Comments="someText" InstallerVersion="400" Compressed="yes" InstallScope="perMachine" Languages="1031"/>
<Media Id="1" Cabinet="application.cab" EmbedCab="yes" CompressionLevel="high"/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Name="LfF" Id="INSTALLDIR">
<Directory Id="BIN" Name="bin"/>
<Component Id="App1.exe" Directory="BIN" Guid="XXX">
<File Id="App1.exe" KeyPath="yes" Source="$(var.src)\App1.exe" />
</Component>
<wix:Component Id="DesktopShortcutApp1" Directory="DesktopFolder" Guid="" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<wix:Shortcut Id="desktopShortcutApp1" Directory="DesktopFolder" Name="App1.exe" Target="[App1.exe]" WorkingDirectory="BIN" Icon="DesktopIconApp1.exe" IconIndex="0" />
<wix:RegistryValue Root="HKCU" Key="Software\[Manufacturer]\App1_Desktop_Shortcut" Name="installed" Type="integer" Value="1" />
</wix:Component>
<Component Id="App2.exe" Directory="BIN" Guid="XXX">
<File Id="App2.exe" KeyPath="yes" Source="$(var.src)\App2.exe" />
</Component>
<wix:Component Id="DesktopShortcutApp2" Directory="DesktopFolder" Guid="" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<wix:Shortcut Id="desktopShortcutApp2" Directory="DesktopFolder" Name="App2.exe" Target="[App2.exe]" WorkingDirectory="BIN" Icon="DesktopIconApp2.exe" IconIndex="0" />
<wix:RegistryValue Root="HKCU" Key="Software\[Manufacturer]\App2_Desktop_Shortcut" Name="installed" Type="integer" Value="1" />
</wix:Component>
</Directory>
</Directory>
</Directory>
<Directory Id="DesktopFolder"/>
<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuDir" Name="MyProductName">
<Component Id="StartMenuShortcuts" Guid="XXX">
<RemoveFolder Id="ProgramMenuDir" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Value=""/>
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="App1" Level="1" Title="App1" TypicalDefault="advertise">
<ComponentRef Id="App1.exe" />
<ComponentRef Id="DesktopShortcutApp1" />
</Feature>
<Feature Id="App2" Level="1" Title="App2" TypicalDefault="advertise">
<ComponentRef Id="App2.exe" />
<ComponentRef Id="DesktopShortcutApp2"/>
</Feature>
<UI>
</UI>
<WixVariable Id="WixUIBannerBmp" Value="..\src\bannerapp.bmp"/>
<WixVariable Id="WixUIDialogBmp" Value="..\src\dialogapp.bmp"/>
<UIRef Id="WixUI_FeatureTree_NoLicense"/>
<Icon Id="DesktopIconApp1.exe" SourceFile="$(var.src)\App1.exe"/>
<Icon Id="DesktopIconApp2.exe" SourceFile=".$(var.src)\App2.exe"/>
</Product>
The script is a shortened version of the original one. Content of the Directory Id="BIN" is generated through heat.exe and modified with xslt.
After a lot of try and error I've found a solution.
make the shortcut element to a child of the component containig the file element
make the icon element to a child of the shortcut element
set the Level="32767" and TypicalDefault="install" in each feature (which means: Do not install that feature)
During the setup process choose the feature(s) you want to install and only for this/these the desktopshortcut will be created.
And here is the code:
<?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="XXX" Name="MyProduct" Language="1031" Codepage="1252" Version="4.4.0" Manufacturer="MyCompany" UpgradeCode="XXX">
<Package Description="MyProductDescription" Comments="someText" InstallerVersion="400" Compressed="yes" InstallScope="perMachine" Languages="1031"/>
<Media Id="1" Cabinet="application.cab" EmbedCab="yes" CompressionLevel="high"/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Name="LfF" Id="INSTALLDIR">
<Directory Id="BIN" Name="bin"/>
<Component Id="App1.exe" Directory="BIN" Guid="XXX">
<File Id="App1.exe" KeyPath="yes" Source="$(var.src)\App1.exe" />
<Shortcut Id="desktopShortcutApp1" Directory="DesktopFolder" Name="App1.exe" WorkingDirectory="BIN" Advertise="yes">
<Icon Id="DesktopApp1.ico" SourceFile="$(var.src)/App1.ico" />
</Shortcut>
</Component>
<Component Id="App2.exe" Directory="BIN" Guid="XXX">
<File Id="App2.exe" KeyPath="yes" Source="$(var.src)\App2.exe" />
<Shortcut Id="desktopShortcutApp2" Directory="DesktopFolder" Name="App2.exe" WorkingDirectory="BIN" Advertise="yes">
<Icon Id="DesktopApp2.ico" SourceFile="$(var.src)/App2.ico" />
</Shortcut>
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="DesktopFolder"/>
<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuDir" Name="MyProductName">
<Component Id="StartMenuShortcuts" Guid="XXX">
<RemoveFolder Id="ProgramMenuDir" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Value=""/>
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="App1" Level="32767" Title="App1" TypicalDefault="install">
<ComponentRef Id="App1.exe" />
</Feature>
<Feature Id="App2" Level="32767" Title="App2" TypicalDefault="install">
<ComponentRef Id="App2.exe" />
</Feature>
<UI>
</UI>
<WixVariable Id="WixUIBannerBmp" Value="$(var.src)/bannerapp.bmp"/>
<WixVariable Id="WixUIDialogBmp" Value="$(var.src)/dialogapp.bmp"/>
<UIRef Id="WixUI_FeatureTree_NoLicense"/>
</Product>
</Wix>
I have searched here for answers but as every case seems to be unique and so far no answers helped me, I decided to post my own. For some reason I am getting the following error about the following code. I can't seem to find anything wrong with it. It has no illegal characters as far as I can see. I've tried with and without the " and it doesn't make a difference. The line specifically referenced in the error is the verb line.
Error:
C:\Users\kylec\Desktop\SampleFirst\SampleFirst.wxs(25) : error LGHT0094 :
Unresolved reference to symbol 'File:Viewer.exe' in section
'Product:{00000000-0000-0000-0000000000000000}'.
Code:
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product Name='Viewer 1.0' Id='PUT-GUID-HERE' UpgradeCode='PUT-GUID-HERE'
Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='Direct'>
<Package Id='*' Keywords='Installer' Description="Installer"
Comments='Installer is a registered trademark of Direct'
Manufacturer='Direct' InstallerVersion='100' Languages='1033'
Compressed='yes' SummaryCodepage='1252' />
<Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
<Property Id='DiskPrompt' Value="Installation [1]" />
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='DataMotionDirect' Name='DMD'>
<Directory Id='INSTALLDIR' Name='Viewer'>
<Component Id='MainExecutable' Guid='*'>
<Shortcut Id="startmenuViewer" Directory="ProgramMenuDir"
Name="Viewer" WorkingDirectory='INSTALLDIR'
Icon="Viewer.exe" IconIndex="0" Advertise="yes" />
<Shortcut Id="desktopViewer" Directory="DesktopFolder"
Name="Viewer" WorkingDirectory='INSTALLDIR'
Icon="Viewer.exe" IconIndex="0" Advertise="yes" />
<File Id='EXE' Name='Viewer.exe' DiskId='1'
Source='Viewer.exe' KeyPath='yes'>
</File>
<ProgId Id="DMDCCDAV" Description="Viewer">
<Extension Id="xml" >
<Verb Id="open" Argument=""%1"" TargetFile="Viewer.exe" />
</Extension>
</ProgId>
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuDir" Name="Viewer">
<Component Id="ProgramMenuDir" Guid="*">
<RemoveFolder Id='ProgramMenuDir' On='uninstall' />
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]'
Type='string' Value='' KeyPath='yes' />
</Component>
</Directory>
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
</Directory>
<Feature Id='Complete' Level='1'>
<ComponentRef Id='MainExecutable' />
<ComponentRef Id='ProgramMenuDir' />
</Feature>
<Icon Id="Viewer.exe" SourceFile="Viewer.exe" />
</Product>
</Wix>
From the piece of source code you specified it is not clear what actual string wix references in fact. Would you kindly either highlight the string or post the entire file?
Ok then after you posted your entire file I see the problematic line. You must use file ID instead of file name there.
I don't have Wix set up to try this, but you can try to move the Shortcut element up to be nested under the Component element and not the File element. Then set the WorkingFolder attribute. Try something like this.
Like I said, I can't compile and test, but try to set the Target attribute to:
Target="[#Viewer.exe]"
<Shortcut Id="ApplicationStartMenuShortcut"
Name="My Application Name"
Description="My Application Description"
Target="[#Viewer.exe]"
WorkingDirectory="INSTALLDIR"/>
So i've been working on this problem for days. My installer simply will not add anything into, or remove anything from, the roaming AppData folder in windows. I'm new to Wix and this is my first installer. The program is also shipped with a Bootstrapper which installs various prequisitaries and the .NET Framework. The code I have used is below.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="USBackup" Language="1033" Version="!(bind.fileVersion.USBackup.exe)" Manufacturer="Ed Rose" UpgradeCode="795ea019-054a-4f34-8c9a-cb4e607897c0">
<Package Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<Icon Id="icon.ico" SourceFile="..\USBackup\resources\usb.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes"/>
<UIRef Id="WixUI_Minimal" />
<UIRef Id="WixUI_ErrorProgressText" />
<PropertyRef Id="NETFRAMEWORK45"/>
<Condition Message='This setup requires the .NET Framework 4.5 installed.'>
<![CDATA[Installed OR NETFRAMEWORK45]]>
</Condition>
<Feature Id="ProductFeature" Title="Setup" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id='ProgramMenuDir' />
<ComponentRef Id='AppDataDir'/>
<ComponentRef Id='DevicesDir'/>
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="USBackup" />
</Directory>
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuDir" Name="USBackup">
<Component Id="ProgramMenuDir" Guid="{B01A59A5-ADA0-43FD-B14F-D479CD002E72}">
<RemoveFolder Id='ProgramMenuDir' On='uninstall' />
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
</Component>
</Directory>
</Directory>
<Directory Id="CommonAppDataFolder" Name="CommonAppData">
<Directory Id="AppDataDir" Name="USBackup">
<Component Id="AppDataDir" Guid="{573BF504-1F52-40FE-A78A-96F43924379E}">
<RemoveFolder Id="AppDataDir" On="uninstall"/>
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
</Component>
<Directory Id="DevicesDir" Name="Devices">
<Component Id="DevicesDir" Guid="{E145EA47-109F-42E7-ABAB-4E9A87FEC464}">
<RemoveFolder Id="DevicesDir" On="uninstall"/>
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Guid="{9D9BA12C-0859-46F0-B5E1-2A59BE96F83D}">
<File Source="$(var.USBackup.TargetPath)" KeyPath="yes">
<Shortcut Id="start" Directory="ProgramMenuDir" Name="USBackup" WorkingDirectory='INSTALLDIR' Icon="icon.ico" IconIndex="0" Advertise="yes" />
</File>
</Component>
<Component Guid="{6B473C52-6901-4FAC-A48B-20FC13A49C21}">
<File Source="..\USBackup\bin\Release\AutoUpdater.NET.dll" KeyPath="yes"/>
</Component>
<Component Guid="{6191F8CC-98A8-4424-A846-44DC1EB2A22C}">
<File Source="..\USBackup\bin\Release\USBackup.exe.config" KeyPath="yes"/>
</Component>
<Component Guid="{4E183A88-69DE-49D1-9142-13A2346443AF}">
<File Source="..\USBackup\bin\Release\USBackup.exe.manifest" KeyPath="yes"/>
</Component>
<!--Set to open on startup-->
<Component Id="RegistryKey" Guid="{8DBAB7DD-D9CD-4EC4-97F9-9A6131B40108}" Shared="yes">
<RegistryKey Root="HKCU" Key="Software\Microsoft\Windows\CurrentVersion\Run">
<RegistryValue Id="startupValue" Action="write" Name="USBackup" Value="[INSTALLFOLDER]USBackup.exe" Type="string"/>
</RegistryKey>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
It builds with no errors or warnings. Why won't it touch the AppData Directory?
You have not given any reason for it to create it.
Include <CreateFolder/>, as such
<Component Id="AppDataDir" Guid="{573BF504-1F52-40FE-A78A-96F43924379E}">
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
<CreateFolder />
</Component>
I am using a WiX to install a service on test machine. But when I do that only the user who installed it on the machine is able to see in the 'Add/Remove Programs' control panel option. But I want to make it visible for every user on the machine.
I did some research and realized that I am not setting the AllUSERS property while creating the installer in the .wxs file.
So I updated my script with this line <Property Id="AllUSERS" Value="1"/> and created the installer. But still only the user who installed can see it in the Control Panel.
Here is my script to create the installer.
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product Name='Importer Service' Id='PUT-GUID-HERE' UpgradeCode='PUT-GUID-HERE'
Language='1033' Codepage='1252' Version='$(var.version)' Manufacturer='Test'>
<Package Id='*' Keywords='Installer' Description="Imports data"
Manufacturer='Test' InstallerVersion='100' Languages='1033' Compressed='yes'
SummaryCodepage='1252' />
<Media Id='1' Cabinet='ImporterWebService.cab' EmbedCab='yes'
DiskPrompt="CD-ROM #1" />
<Property Id='DiskPrompt' Value="Importer Web Service 1.0 Installation [1]" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
<Property Id="AllUSERS" Value="1"/>
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='Test' Name='Test1'>
<Directory Id='INSTALLDIR' Name='Importer Service'>
<Component Id='MainExecutable' Guid='*'>
<File Id='ImporterWindowsServiceEXE'
Name='Importer.WindowsService.exe' DiskId='1'
Source='Importer.WindowsService.exe' KeyPath='yes'>
</File>
<ServiceInstall
Id="ImporterServiceInstaller"
Type="ownProcess"
Vital="yes"
Name="Importer Service"
DisplayName="Importer Service"
Description="Imports data."
Start="demand"
Account="LocalSystem"
ErrorControl="ignore"
Interactive="no">
</ServiceInstall>
<ServiceControl Id="StartService" Stop="both" Remove="uninstall"
Name="Importer Service" Wait="yes" />
</Component>
<Component Id='FileHelpersLibrary' Guid='*'>
<File Id='FileHelpersDLL' Name='FileHelpers.dll' DiskId='1'
Source='FileHelpers.dll' KeyPath='yes' />
</Component>
<Component Id='CodeSmithDataLibrary' Guid='*'>
<File Id='CodeSmithDataDLL' Name='CodeSmith.Data.dll' DiskId='1'
Source='CodeSmith.Data.dll' KeyPath='yes' />
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuDir" Name="Importer Service">
<Component Id="ProgramMenuDir" Guid="*">
<RemoveFolder Id='ProgramMenuDir' On='uninstall' />
<RegistryValue Root='HKCU'
Key='Software\[Manufacturer]\[ProductName]'
Type='string' Value='' KeyPath='yes' />
</Component>
</Directory>
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
</Directory>
<Feature Id='Complete' Title='Importer Service'
Description='The complete package'
Display='hidden' Level='1' ConfigurableDirectory='INSTALLDIR'>
<ComponentRef Id='MainExecutable' />
<ComponentRef Id='FileHelpersLibrary' />
<ComponentRef Id='CodeSmithDataLibrary' />
<ComponentRef Id='ProgramMenuDir' />
</Feature>
<UIRef Id="WixUI_InstallDir" />
<UIRef Id="WixUI_ErrorProgressText" />
</Product>
</Wix>
Could someone please look at the script and let me know what I am doing wrong.
Thanks.
Instead of setting ALLUSERS explicitly, try setting the InstallScope of the Package element to perMachine. According to the documentation, this fact:
Set this value to declare that the package is a per-machine
installation and requires elevated privileges to install. Sets the
ALLUSERS property to 1.
So, it should do the required job under the hood.