creating msi using nant and wix - wix

I am trying to create an installer for my project using NAnt.
this is how my build script looks like
<?xml version="1.0"?>
<project name="pleats" default="build-release" xmlns="http://nant.sf.net/release/0.85/nant.xsd">
<target name="build-release" depends="clean, make-builddir, build, release-properties, copy-to-release, build-installer" />
<property name="tools.dir" value="${path::get-full-path('tools')}" />
<property name="src.dir" value="${path::get-full-path('src')}" />
<property name="build.dir" value="D:\Subrat\Projects\WPF\WpfApplicationNAntTest\WpfApplicationNAntTest\bin\Debug" />
<target name="clean" description="Delete automated build artifacts">
<delete dir="${build.dir}" if="${directory::exists(build.dir)}" failonerror="false"/>
</target>
<target name="make-builddir" description="Create build dir and build report dir">
<mkdir dir="${build.dir}" unless="${directory::exists(build.dir)}" />
</target>
<target name="release-properties">
<property name="release.dir" value="D:\Subrat\Projects\WPF\WpfApplicationNAntTest\WpfApplicationNAntTest\bin\Release"/>
<property name="wix.dir" value="D:\Subrat\Projects\WPF\WpfApplicationNAntTest\Lib\wix"/>
</target>
<target name="copy-to-release">
<mkdir dir="${release.dir}" failonerror="false"/>
<copy todir="${release.dir}">
<fileset basedir="${src.dir}">
<include name="*" />
</fileset>
</copy>
</target>
<target name="build">
<loadtasks assembly="D:\Subrat\Projects\WPF\WpfApplicationNAntTest\Lib\nantcontrib-0.85\bin\NAnt.Contrib.Tasks.dll"/>
<msbuild project="D:\Subrat\Projects\WPF\WpfApplicationNAntTest\WpfApplicationNAntTest.sln">
<property name="configuration" value="debug" />
<property name="Platform" value="any cpu" />
</msbuild>
</target>
<target name="build-installer">
<!-- for wix preprocessor so that the location of pleats files are propagated into the wxs -->
<setenv name="pleats.dir" value="${release.dir}"/>
<delete>
<fileset>
<include name="${wix.dir}/*.wixobj"/>
</fileset>
</delete>
<exec program="${wix.dir}\candle.exe" workingdir=".\wix" commandline="SampleFirst.wxs " />
<exec program="${wix.dir}\light.exe" workingdir=".\wix" commandline="-ext WixUIExtension -cultures:en-us SampleFirst.wixobj -out ${release.dir}\pleats.msi"/>
</target>
</project>
I am using the sample wxs file i got in wix tutorial.
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product Name='Foobar 1.0' Id='C2B662FC-82AA-11DF-93D4-6B70DFD72085' UpgradeCode='CE3E5F1C-82AA-11DF-A42F-7170DFD72085'
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' />
<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='DD4C895C-82AA-11DF-941D-8370DFD72085'>
<File Id='FoobarEXE' Name='WpfApplicationNAntTest.exe' DiskId='1' Source='D:\Subrat\Projects\WPF\WpfApplicationNAntTest\WpfApplicationNAntTest\bin\Debug\WpfApplicationNAntTest.exe' KeyPath='yes'>
<Shortcut Id="startmenuFoobar10" Directory="ProgramMenuDir" Name="Foobar 1.0" WorkingDirectory='INSTALLDIR' Icon="WpfApplicationNAntTest.exe" IconIndex="0" Advertise="yes" />
<Shortcut Id="desktopFoobar10" Directory="DesktopFolder" Name="Foobar 1.0" WorkingDirectory='INSTALLDIR' Icon="WpfApplicationNAntTest.exe" IconIndex="0" Advertise="yes" />
</File>
</Component>
<!--<Component Id='HelperLibrary' Guid='YOURGUID-6BE3-460D-A14F-75658D16550B'>
<File Id='HelperDLL' Name='Helper.dll' DiskId='1' Source='Helper.dll' KeyPath='yes' />
</Component>
<Component Id='Manual' Guid='YOURGUID-574D-4A9A-A266-5B5EC2C022A4'>
<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="E510F3DA-82AA-11DF-8814-8970DFD72085">
<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='HelperLibrary' />
<ComponentRef Id='Manual' />-->
<ComponentRef Id='ProgramMenuDir' />
</Feature>
<Icon Id="WpfApplicationNAntTest.exe" SourceFile="WpfApplicationNAntTest.exe" />
<UIRef Id="WixUI_Minimal" />
</Product>
</Wix>
when i am trying to make an installer i am geting this error -
the system cannot find the file WpfApplicationNAntTest.exe
i dont have much idea about Nant or wix as i am new to this. Please help.

I think you need to specify the full path in the Icon element, SourceFile attribute to where the WpfApplicationNantTest.exe is.
Something like:
<Icon
Id="WpfApplicationNAntTest.exe"
SourceFile="D:\Subrat\Projects\WPF\WpfApplicationNAntTest\bin\debug\WpfApplicationNAntTest.exe" />

Related

WIX: light.exe hangs when compiling

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 ?

What RegistryValue Root should be used in case of Single Package Authoring installation?

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.

Single Package Authoring

I am trying to create Single Package Authoring installation using following tutorial - http://www.egoroff.spb.ru/blog/62003.html
Main wix file is following:
<?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>
According to this tutorial if application will be installed by plain user then it will be installed "per user", if application will be installed by administrator, then it should be installed "per machine".
In my case if I run msi file as a plain user then this test application is installed per user.
But if I run cmd.exe "as administrator" and then run created msi file from that administrator's cmd.exe application then application is installed per user again, not per machine.
What should I do to install application per machine?
Should I change something in wxs code?
Or should I install my application using some other approach?
Try setting ALLUSERS=1 on the msiexec.exe command line. This yields a per machine installation with shared shortcuts for all users:
msiexec.exe /i File.msi ALLUSERS=1
This relates to the larger issue of "Installation context". Check out the linked MSDN documentation.
Recommended links:
All users/Current user installation with/without Administrative privileges
Setting the 'AllUsers' option on Wix installer does not work
Authoring a single package for Per-User or Per-Machine Installation context in Windows 7

MSi installation Error

have created MSI using Wix. When I am trying to install it, I am getting the below error.
"The installer has insufficient privileges to access this directory c:\programfiles\AppTest.The installation can not continue log on as administrator or contact your system administrator".
I went through some of similar post but it did not helped me.Below in my code.
<?xml version='1.0'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product Name='AppTest' Id='*'enter code here
UpgradeCode='{05E35D34-E7F6-4CED-BF86-B1747AE92E07}'
Language='1033' Codepage='1252'
Version='2.0.0.1'
Manufacturer='LabView Inc' >
<Package Id='*'
Languages='1033'
SummaryCodepage='1252'
AdminImage='no'
InstallerVersion='200'
InstallPrivileges='elevated'
Compressed='yes'
ReadOnly='yes'
ShortNames='yes'
Comments='AppTest Installer Package'
Description='AppTest Installer Package'
Manufacturer='LabView Inc' />
<Media Id='1' Cabinet='AppTest.cab' EmbedCab='yes' />
<!--Directory structure-->
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder'>
<Directory Id="APPLICATIONROOTDIRECTORY" Name="AppTest"/>
</Directory>
</Directory>
<!-- Adding Components-->
<DirectoryRef Id="TARGETDIR">
<Component Id="AppTest.dll" Guid="3947344C-8116-48FB-9F8A-080EA7D1ABAD">
<File Id="AppTest.dll" Source="$(sys.CURRENTDIR)files\AppTest.dll" KeyPath="yes" Checksum="yes"/>
<File Id="msvcp80.dll" Source="$(sys.CURRENTDIR)files\msvcp80.dll" />
<File Id="atl80.dll" Source="$(sys.CURRENTDIR)files\atl80.dll" />
<File Id="msvcr80.dll" Source="$(sys.CURRENTDIR)files\msvcr80.dll" />
<File Id="Microsoft.VC80.ATL.manifes" Source="$(sys.CURRENTDIR)files\Microsoft.VC80.ATL.manifest" />
<File Id="Microsoft.VC80.CRT.manifest" Source="$(sys.CURRENTDIR)files\Microsoft.VC80.CRT.manifest" />
<File Id="AppTest.inf" ReadOnly="yes" Source="$(sys.CURRENTDIR)files\AppTest.inf" />
</Component>
</DirectoryRef>
<Feature Id="AppTestFeature" Title="AppTest" Level="1">
<ComponentRef Id="AppTest.dll" />
</Feature>
</Product>
You should remove <CreateFolder Directory='AppTest' /> and change code to this:
<DirectoryRef Id="APPLICATIONROOTDIRECTORY"> <!-- main folder ur app -->
<Component Id="AppTest.dll" Guid="3947344C-8116-48FB-9F8A-080EA7D1ABAD">
<File Id="AppTest.dll" Source="$(sys.CURRENTDIR)files\AppTest.dll" KeyPath="yes" Checksum="yes"/>
<File Id="msvcp80.dll" Source="$(sys.CURRENTDIR)files\msvcp80.dll" />
<File Id="atl80.dll" Source="$(sys.CURRENTDIR)files\atl80.dll" />
<File Id="msvcr80.dll" Source="$(sys.CURRENTDIR)files\msvcr80.dll" />
<File Id="Microsoft.VC80.ATL.manifes" Source="$(sys.CURRENTDIR)files\Microsoft.VC80.ATL.manifest" />
<File Id="Microsoft.VC80.CRT.manifest" Source="$(sys.CURRENTDIR)files\Microsoft.VC80.CRT.manifest" />
<File Id="AppTest.inf" ReadOnly="yes" Source="$(sys.CURRENTDIR)files\AppTest.inf" />
</Component>
</DirectoryRef>

Setting the 'AllUsers' option on Wix installer does not work

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.