I am developing a wix code to create a msi. i have added all the components and libraries to my wix project.But,i am not able to create a msi as i need.Please help me out.Here is my code,
<?xml version='1.0' encoding='UTF-8'?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Name='SmartViewer'
Id="*"
Language='1033'
Codepage='1252'
Version='1.0.0'
UpgradeCode='9C5E4073-EFDE-419B-935D-CE2632BC560E'>
<Package Keywords='Installer,MSI'
InstallerVersion='100'
Languages='1031'
Compressed='yes'
SummaryCodepage='1252' />
<Media Id="1" Cabinet="myapp.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="MyProgramDir" Name="myproject" >
<Directory Id="INSTALLFOLDER" Name="proj1" />
</Directory>
</Directory>
<DirectoryRef Id="INSTALLFOLDER">
<Component Id='MainExecutable' Guid='*'>
<File Id='ExecutableFile' Name='mv.exe' DiskId='1' Source='mv.exe' KeyPath='yes'/>
</Component>
<Directory Id="imageformats" Name="imageformats">
<Component Id='jpeg4Library' Guid='*'>
<File Id='jpeg4' Name='jpeg4.dll' DiskId='1' Source='jpeg4.dll' KeyPath='yes' />
</Component>
</Directory>
<Component Id='Network4Library' Guid='*'>
<File Id='Network4' Name='Network4.dll' DiskId='1' Source='Network4.dll' KeyPath='yes' />
</Component>
<Component Id='Multimedia4Library' Guid='*'>
<File Id='Multimedia4' Name='Multimedia4.dll' DiskId='1' Source='Multimedia4.dll' KeyPath='yes' />
</Component>
<Component Id='QtGui4Library' Guid='*'>
<File Id='Gui4' Name='Gui4.dll' DiskId='1' Source='Gui4.dll' KeyPath='yes' />
</Component>
<Component Id='Designer4Library' Guid='*'>
<File Id='Designer4' Name='Designer4.dll' DiskId='1' Source='Designer4.dll' KeyPath='yes' />
</Component>
<Component Id='Core4Library' Guid='*'>
<File Id='Core4' Name='Core4.dll' DiskId='1' Source='Core4.dll' KeyPath='yes' />
</Component>
<Component Id='libmfxsw32Library' Guid='*'>
<File Id='libmfxsw32' Name='libmfxsw32.dll' DiskId='1' Source='libmfxsw32.dll' KeyPath='yes' />
</Component>
<Component Id='libiomp5mdLibrary' Guid='*'>
<File Id='libiomp5md' Name='libiomp5md.dll' DiskId='1' Source='libiomp5md.dll' KeyPath='yes' />
</Component>
<Component Id='ippcore7.1Library' Guid='*'>
<File Id='ippcore7.1' Name='ippcore-7.1.dll' DiskId='1' Source='ippcore-7.1.dll' KeyPath='yes' />
</Component>
<Component Id='ippccw77.1Library' Guid='*'>
<File Id='ippccw77.1' Name='ippccw7-7.1.dll' DiskId='1' Source='ippccw7-7.1.dll' KeyPath='yes' />
</Component>
<Component Id='ippccv87.1Library' Guid='*'>
<File Id='ippccv87.1' Name='ippccv8-7.1.dll' DiskId='1' Source='ippccv8-7.1.dll' KeyPath='yes' />
</Component>
<Component Id='ippccs87.1Library' Guid='*'>
<File Id='ippccs87.1' Name='ippccs8-7.1.dll' DiskId='1' Source='ippccs8-7.1.dll' KeyPath='yes' />
</Component>
<Component Id='ippccp87.1Library' Guid='*'>
<File Id='ippccp87.1' Name='ippccp8-7.1.dll' DiskId='1' Source='ippccp8-7.1.dll' KeyPath='yes' />
</Component>
<Component Id='ippccg97.1Library' Guid='*'>
<File Id='ippccg97.1' Name='ippccg9-7.1.dll' DiskId='1' Source='ippccg9-7.1.dll' KeyPath='yes' />
</Component>
<Component Id='ippcc7.1Library' Guid='*'>
<File Id='ippcc7.1' Name='ippcc-7.1.dll' DiskId='1' Source='ippcc-7.1.dll' KeyPath='yes' />
</Component>
<Component Id='EULALibrary' Guid='*'>
<File Id='EULA' Name='EULA.rtf' DiskId='1' Source='EULA.rtf' KeyPath='yes' />
</Component>
</DirectoryRef>
<Directory Id="ProgramFilesFolder">
<Directory Id="MyProgramDir" Name="myproj" >
<Directory Id="INSTALLFOLDER" Name="proj1" /
<Component Id="TextFileComponent" Guid="*">
<File Id="TextFile" Name="Logs.txt" DiskId="1"
Source="Logs.txt" KeyPath="yes" />
</Component>
</Directory>
</Directory>
<Directory Id="DesktopFolder">
<Component Id="ExecutableFileShortcutComponent" Guid="*">
<Shortcut Id="ExecutableFileShortcut" Name="smart viewer"
Description="Shortcut To Executable File"
Target="[INSTALLFOLDER]mv.exe" />
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="MyProgramDir" Name="myproj">
<Component Id="ExecutableFileShortcutComponent" Guid="*">
<Shortcut Id="ExecutableFileShortcut" Name="smart viewer"
Description="Shortcut To Executable File"
Target="[INSTALLFOLDER]mv.exe" />
</Component>
</Directory>
</Product>
</Wix>
The components are not getting the dll path.I tried passing the path to source in file id,still i find the same issue.Looking forward for a good suggestion.
You need to reference the full path to the files:
<File Id="Microsoft.Practices.Unity"
Name="jpeg4.dll"
Source="$(var.BuildOutputDir)\jpeg4.dll" />
where $(var.BuildOutputDir) is the full path to a folder. If these files are in the output of another referenced project then you can use $(var.OtherProject.TargetDir)
Your file does not contain valid XML. The following fragment is broken.
<Directory Id="ProgramFilesFolder">
<Directory Id="MyProgramDir" Name="myproj" >
<Directory Id="INSTALLFOLDER" Name="proj1" /
<Component Id="TextFileComponent" Guid="*">
<File Id="TextFile" Name="Logs.txt" DiskId="1"
Source="Logs.txt" KeyPath="yes" />
</Component>
</Directory>
</Directory>
The line
<Directory Id="INSTALLFOLDER" Name="proj1" /
should be
<Directory Id="INSTALLFOLDER" Name="proj1" >
There is one </Directory> missing. You should also add </Component> at two positions. Try WiXEdit that points to invalid XML when it loads a .WXS file.
Additionally you should add a <feature>.
Related
I have this MSI which is included in my burn bootstrap EXE. When I uninstall this MSI, and when there are no other MSIs left installed, uninstalling this MSI wouldn't remove the parent installation folder (testInstallDir). Below is my wix file.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="MosquittoInstaller" Language="1033" Version="3.0.7.0" Manufacturer="Zone24x7" UpgradeCode="b2cb73e9-bce8-463f-986d-b3f8f13283dd">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallInitialize"/>
<MediaTemplate EmbedCab="yes"/>
<Feature Id="ProductFeature" Title="MosquittoInstaller" Level="1">
<ComponentGroupRef Id="MosquittoFilesGroup"/>
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLLOCATION">
<Directory Id="testInstallDir" Name="test2.0">
<Directory Id="MyProgramDir" Name="Mosquitto" />
</Directory>
</Directory>
</Directory>
<CustomAction Id='RunMosquitto' FileKey="fil7D28AEF774656849395A2FA20A5C963D" Execute="deferred" ExeCommand='-v' Return="asyncNoWait" HideTarget="no" Impersonate="no"/>
</Fragment>
<Fragment>
<DirectoryRef Id="MyProgramDir">
<Directory Id="dirC8FCCB6AC509A125EE3B37CC7E907774" Name="devel" />
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="MosquittoFilesGroup">
<Component Id="cmp4D47D22EE0C10F2FE658B4D343E1153F" Directory="MyProgramDir" Guid="5458BA33-9B08-46E1-8EE7-DE516F2FEF64">
<File Id="filFC4C205CAB822D245B62422765716A32" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/aclfile.example" />
</Component>
<Component Id="cmp3245A363F29E5F92EEFB67D8F4A466FD" Directory="MyProgramDir" Guid="1ED7F2BD-692C-4C96-8CF5-C2064B64BF8D">
<File Id="filB660EA30BBEBA21E457F2F3CA4811CC9" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/ChangeLog.txt" />
</Component>
<Component Id="cmpA2A091D2A61C720ED9AE76DAF2674BE6" Directory="MyProgramDir" Guid="5F780D6F-F8BB-4BF6-84F6-EF8613404775">
<File Id="fil83340F4F2CEADCD75C02CB23AEE43E5B" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/edl-v10" />
</Component>
<Component Id="cmp6F9F08890072C152F5FADAD0D513493C" Directory="MyProgramDir" Guid="BE80EDA6-28FC-4C0D-8BAC-94FA8AE5BB94">
<File Id="fil60C98E7B75120C739F33F0C7ABF52318" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/epl-v10" />
</Component>
<Component Id="cmpB04A2DC39867DD744B3591AC2AFB49BC" Directory="MyProgramDir" Guid="236F6263-DCDB-42BC-8DA3-8D23189EC331">
<File Id="fil93F56A00DDA348881B22245DADDB4F5A" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/libeay32.dll" />
</Component>
<Component Id="cmp3FA55FD836AD7B4095DAFD837A100110" Directory="MyProgramDir" Guid="7ED4C914-E66F-4F39-AC4E-A24123BF394C">
<File Id="fil711449631134E31C4C38DCA6C4FCD922" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/libssl32.dll" />
</Component>
<Component Id="cmpBA00B50D8224C040011EC424B900FE43" Directory="MyProgramDir" Guid="EF6C19F7-CCC3-4C61-B5B8-DE01A0C6D55E">
<File Id="filA995207A6EF3FF0B4A1912B4627C6A9E" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/mosquitto.conf" />
</Component>
<Component Id="cmp4587500C7F4126281D74E67979861A5F" Directory="MyProgramDir" Guid="E81C33BB-226C-40F2-AE05-6F0EDFEDEA00">
<File Id="filF89C2DB7028E205E7170A35A8F9520E6" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/mosquitto.dll" />
</Component>
<Component Id="cmp59455E1C37B7879C4BC250DE3D60A2AD" Directory="MyProgramDir" Guid="179B4F4C-912B-4CA1-8F08-5E1B4ADFFD8B">
<File Id="fil7D28AEF774656849395A2FA20A5C963D" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/mosquitto.exe" />
</Component>
<Component Id="cmpFC2AA06F4719D34513B7E5E9EB230B41" Directory="MyProgramDir" Guid="C9CD68F9-77B1-481B-91ED-21AC8A84C4D7">
<File Id="fil217773E50C3CCD997EE125E6B0195649" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/mosquittopp.dll" />
</Component>
<Component Id="cmp783743C36FE8E1154B0AE9E72AC7D575" Directory="MyProgramDir" Guid="B5717FA1-FE2D-4617-814E-4492EA4D8807">
<File Id="filCB4D3062E6881D66561E91BD301B39EC" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/mosquitto_passwd.exe" />
</Component>
<Component Id="cmpB524C33DDFC8EBC62B98F9EBFC7807D0" Directory="MyProgramDir" Guid="68E7A8B3-DC15-404F-98D1-20487419D254">
<File Id="fil5F8821D626DC542D506A561E82B226A6" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/mosquitto_pub.exe" />
</Component>
<Component Id="cmp3F0A99A6FCDA4B694FD5CFAFDC8A80CF" Directory="MyProgramDir" Guid="7B83878B-3F39-4FFA-8FDC-FDFA88E882A5">
<File Id="fil4C12390E7E7C75828D70CEBED7733FCE" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/mosquitto_sub.exe" />
</Component>
<Component Id="cmpEA7CE0C91970F57073BB84F8319AB6E9" Directory="MyProgramDir" Guid="34F20F13-0533-4029-87BE-C248FEBC8BC6">
<File Id="fil431A1BF1C3B5AC45CE630487A7C4F945" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/pthreadVC2.dll" />
</Component>
<Component Id="cmp7501765F72B0586A968FAC0B19C630D3" Directory="MyProgramDir" Guid="4A041354-E31D-4074-83EA-5EB162E9088F">
<File Id="fil542FD8A849709E85C839FE825E8F7381" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/pwfile.example" />
</Component>
<Component Id="cmp9AA04B6F826A4FBEDDADF82E79A761E1" Directory="MyProgramDir" Guid="B48E76CB-C1A4-4E33-8D1C-93F17CF02CEE">
<File Id="fil9A73011E316138ECF5FA538F5FFA4E65" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/readme-windows.txt" />
</Component>
<Component Id="cmp32A4C8B2CEA9C2B249897CE3C6B247C6" Directory="MyProgramDir" Guid="584E5D69-990B-4CA7-808E-B0CB16061501">
<File Id="fil5ED5D6BCA1089DC259C7CBA92488771F" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/readme.txt" />
</Component>
<Component Id="cmpC98F4A8F1680E1A63542439212B11AE5" Directory="MyProgramDir" Guid="6B20C0FB-1EF6-47FA-8CF7-6670388E1EE4">
<File Id="fil85C65E95EE6846B0F10A532F68143610" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/ssleay32.dll" />
</Component>
<Component Id="cmp077EB2DAE856A91792B2F5D25E1657B1" Directory="MyProgramDir" Guid="380D7E34-F52D-495B-AD44-98496DA86C39">
<File Id="fil2C766C617C17E139FD0C4383EA2836C2" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/Uninstall.exe" />
</Component>
<Component Id="cmp75F7F5A733463114C1AE70CEE007EF5B" Directory="MyProgramDir" Guid="87C8326B-F7BE-48F4-B8E6-3C328EE3699B">
<File Id="fil6EFD0D9154A77F9F83AD40E108ABC645" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/websockets.dll" />
</Component>
<Component Id="cmpED679856D0F7640ABA659DEB9A01EB0C" Directory="dirC8FCCB6AC509A125EE3B37CC7E907774" Guid="B576C2B4-4157-469C-86E2-B869214CC64A">
<File Id="fil2AC1DBC8C2D9F23E430E4C762DCDE74D" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/devel/mosquitto.h" />
</Component>
<Component Id="cmp6E8EC27B07C11656CE96CA872FF39F60" Directory="dirC8FCCB6AC509A125EE3B37CC7E907774" Guid="78387CDF-FE90-464A-8D3F-BDD42B89C26C">
<File Id="filEEC89BDE9E29C6E182307F4C6826890A" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/devel/mosquitto.lib" />
</Component>
<Component Id="cmp85BF1685089A4DC262B71CEDC73FA6B3" Directory="dirC8FCCB6AC509A125EE3B37CC7E907774" Guid="F434B6D5-8A93-43CF-AC26-DE89F52E5A7E">
<File Id="fil7F5D72039158A30AF8EAA068868BBEF6" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/devel/mosquittopp.h" />
</Component>
<Component Id="cmp8D747BA62B3F712D6A73536CB1C1EA26" Directory="dirC8FCCB6AC509A125EE3B37CC7E907774" Guid="BBF1DD11-F7C9-4823-ADC4-B31657B05ECF">
<File Id="filA474F6FBE224F895B1554D05DE2F419D" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/devel/mosquittopp.lib" />
</Component>
<Component Id="cmpB2DF497560B4E99936D5598EE54D381B" Directory="dirC8FCCB6AC509A125EE3B37CC7E907774" Guid="B0A4C898-AC74-4329-A88E-9321381B0EB9">
<File Id="fil0F36E85111041DA1F5ABEFF409812AFA" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/devel/mosquitto_plugin.h" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
What am I doing wrong here? There are no files left. Just the empty test2.0 folder remains. Please advice.
Ideally msiexec /x {ProductGUID} should remove all folders and files unless components are marked shared/permanent, if not it's an issue with your setup or something you're doing with your application. Please provide other details related to this.
As a last resort you can use REMOVEFILE to remove the directory during Uninstallation:
<Component Id="NEWCOMP" Guid="">
<RemoveFile Id="RemoveInstallFolder" Name="*" On="uninstall" Directory="INSTALLFOLDER" />
</Component>
I have trouble with my installer file. The installer does build without any error but when I try to install it on another computer (which obvious doesn't have have the required assemblies) I am getting an error which says that the assembly couldn't be found. Do I miss something obvious?
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Recap" Language="1033" Version="1.0.0.0" Manufacturer="Lavahayn Technology" UpgradeCode="6824BC1E-B8AD-4EE0-B3F7-B3E84859B9F9">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<WixVariable Id="WixUILicenseRtf" Value="license.rtf" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<UIRef Id="WixUI_InstallDir" />
<Feature Id="ProductFeature" Title="Recap" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id="ApplicationShortcuts"/>
<ComponentRef Id="UninstallerShortCut" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="Company" Name="Lavahayn Technology" >
<Directory Id="INSTALLFOLDER" Name="Recap" >
<Component Id="UninstallerShortCut" Guid="3AE87174-A4B1-4887-8D23-5CC651B0CED8">
<Shortcut Id="UninstallProduct2"
Name="Uninstall"
Description="Removes Recap from your computer"
Target="[System64Folder]msiexec.exe"
Arguments="/x [ProductCode]"/>
<RemoveFolder Id="INSTALLFOLDER" On="uninstall"/>
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuSubfolder" Name="Lavahayn Technology">
<Component Id="ApplicationShortcuts" Guid="432BC349-14B9-4224-B226-A0C55B25498A">
<Shortcut Id="RecapShortcut" Name="Recap" Description="Lavahayn Technology Recap"
Target="[INSTALLDIR]LavahaynTechnology.Launcher.exe" WorkingDirectory="INSTALLDIR"/>
<RegistryValue Root="HKCU" Key="Software\LavahaynTechnology\Recap"
Name="installed" Type="integer" Value="1" KeyPath="yes"/>
<Shortcut Id="UninstallProduct"
Name="Uninstall"
Description="Removes Recap from your computer"
Target="[System64Folder]msiexec.exe"
Arguments="/x [ProductCode]"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
</Component>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="LavahaynTechnology.CsharpRecap.exe" Guid="1006A341-572D-45D7-9C0E-6F199C1CF0F5">
<File Id="LavahaynTechnology.CsharpRecap.exe" Source="$(var.CsharpRecap.TargetDir)CsharpRecap.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="LavahaynTechnology.Database.dll" Guid="872452AA-7075-450B-A28F-90252E9DBB6F">
<File Id="LavahaynTechnology.Database.dll" Source="$(var.LavahaynTechnology.Database.TargetDir)LavahaynTechnology.Database.dll" KeyPath="yes" Assembly=".net"/>
</Component>
<Component Id="LavahaynTechnology.Launcher.exe" Guid="C0FEB7B4-87BF-4120-A40C-A5849B84F6DA">
<File Id="LavahaynTechnology.Launcher.exe" Source="$(var.LavahaynTechnology.Launcher.TargetDir)LavahaynTechnology.Launcher.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="LavahaynTechnology.SDK.dll" Guid="55A6AEDA-162D-4BB7-9F7E-0BFBCB738402">
<File Id="LavahaynTechnology.SDK.dll" Source="$(var.LavahaynTechnology.SDK.TargetDir)LavahaynTechnology.SDK.dll" KeyPath="yes" Assembly=".net" />
</Component>
<Component Id="LavahaynTechnology.ObjectBase.dll" Guid="259F7357-D000-4B97-BA29-F11A176319CB">
<File Id="LavahaynTechnology.ObjectBase.dll" Source="$(var.LavahaynTechnology.ObjectBase.TargetDir)LavahaynTechnology.ObjectBase.dll" KeyPath="yes" Assembly=".net" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
Error Message
I was reviewing some statements which came from the dark.exe decompiled output of an installshield msi file.
One section, for an example:
<Directory Id='INSTALLDIR' Name="$(var.BasicProductName)">
...
<Component Id="Comp1" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<CreateFolder Directory="INSTALLDIR" />
...
</Component>
<Component Id="Comp2" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<CreateFolder Directory="INSTALLDIR" />
...
</Component>
<Directory Id="UHDDRIVER" Name="UHDDriver">
<Component Id="MyUHD" Guid="xx" SharedDllRefCount="yes" Win64="$(var.Win64)">
<File Id="MyUHD.inf" Name="MyUHD.inf" KeyPath="yes" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\MyUHD.inf" />
<File Id="MyUHD_.cat" Name="MyUHD_.cat" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\MyUHD_.cat" />
<Driver AddRemovePrograms="no" DeleteFiles="yes" Legacy="yes" PlugAndPlayPrompt="no" Sequence="2" xmlns="http://schemas.microsoft.com/wix/DifxAppExtension" />
</Component>
<Component Id="UHDDriver_Dir" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<CreateFolder Directory="UHDDRIVER" />
</Component>
<Directory Id="AMD644" Name="AMD64">
<Component Id="MyUHD_AMD64" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<File Id="MyUHD.sys1" Name="MyUHD.sys" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\AMD64\MyUHD.sys" />
</Component>
</Directory>
<Directory Id="X864" Name="x86">
<Component Id="MyUHD_x86" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<File Id="MyUHD.sys" Name="MyUHD.sys" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\X86\MyUHD.sys" />
</Component>
</Directory>
</Directory>
</Directory>
Wondering if I can optimize the CreateFolder tags as follows:
<Directory Id='INSTALLDIR' Name="$(var.BasicProductName)">
...
<Component Id="Comp1" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<CreateFolder />
...
</Component>
<Component Id="Comp2" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
...
</Component>
<Directory Id="UHDDRIVER" Name="UHDDriver">
<Component Id="MyUHD" Guid="xx" SharedDllRefCount="yes" Win64="$(var.Win64)">
<CreateFolder />
<File Id="MyUHD.inf" Name="MyUHD.inf" KeyPath="yes" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\MyUHD.inf" />
<File Id="MyUHD_.cat" Name="MyUHD_.cat" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\MyUHD_.cat" />
<Driver AddRemovePrograms="no" DeleteFiles="yes" Legacy="yes" PlugAndPlayPrompt="no" Sequence="2" xmlns="http://schemas.microsoft.com/wix/DifxAppExtension" />
</Component>
<Directory Id="AMD644" Name="AMD64">
<Component Id="MyUHD_AMD64" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<File Id="MyUHD.sys1" Name="MyUHD.sys" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\AMD64\MyUHD.sys" />
</Component>
</Directory>
<Directory Id="X864" Name="x86">
<Component Id="MyUHD_x86" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<File Id="MyUHD.sys" Name="MyUHD.sys" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\X86\MyUHD.sys" />
</Component>
</Directory>
</Directory>
</Directory>
Note that I removed the component Id UHDDriver_Dir and replaced it with a CreateFolder tag in the first component, thinking that an empty CreateFolder simply operates on the last known Directory tag - is that correct? Am I okay for install/uninstall to remove that component, or do I need a defined component and guid for each dir I create?
Are there other optimizations I am missing here?
I have a VB.net based WiX installer which seems to function as required in that it copies all the relevent files to the target folders on the machine, however for some reason the installer does not appear to present the application in Programs and Features. I am a relative newbie to WiX and based this WiX Installer project on a previous Windows Service project that I developed, which worked properly. Hoping someone can point out to me where I am going wrong. Code detailed below, please note all registry entries and GUIDs have been hashed-out for security purposes:
<?xml version="1.0" encoding="UTF-8"?>
<?define SourceDir = "..\..\Bin\Debug" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="*" Name="PSALERTSClient" Language="1033" Version="1.0.0.0" Manufacturer="Iberdrola, S.A." UpgradeCode="a6fd9179-efe6-47d1-bd8f-aec182d36c8b">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Feature Id="ProductFeature" Title="PSALERTS Client" Level="1">
<ComponentRef Id="cmpDirQuery" />
<ComponentRef Id="cmpDirQueryOutput" />
<ComponentRef Id="cmpQueryExe" />
<ComponentRef Id="cmpQueryPdb" />
<ComponentRef Id="cmpBusinessLogicDll" />
<ComponentRef Id="cmpBusinessLogicPdb" />
<ComponentRef Id="cmpBusinessObjectDll" />
<ComponentRef Id="cmpBusinessObjectPdb" />
<ComponentRef Id="cmpCommonDll" />
<ComponentRef Id="cmpCommonPdb" />
<ComponentRef Id="cmpDataAccessDll" />
<ComponentRef Id="cmpDataAccessPdb" />
<ComponentRef Id="cmpDPAPIHelperDll" />
<ComponentRef Id="cmpDPAPIHelperPdb" />
<ComponentRef Id="cmpLoggerDll" />
<ComponentRef Id="cmpLoggerPdb" />
<ComponentRef Id="cmpPSALERTSIni" />
<ComponentRef Id="cmpPSALERTSXltm" />
<ComponentRef Id="cmpPSALERTSUserGuideChm" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="dirSPEnergyNetworks" Name="SP Energy Networks">
<!-- <Component Id="cmpDirSPEnergyNetworks" Guid="{####################################}" Transitive="yes" /> -->
<Directory Id="dirPSALERTS" Name="PSALERTS">
<!-- <Component Id="cmpDirPSALERTS" Guid="{####################################}" Transitive="yes" /> -->
<Directory Id="dirQuery" Name="Query">
<Component Id="cmpDirQuery" Guid="{####################################}" KeyPath="yes">
<CreateFolder Directory="dirQuery" />
<RemoveFile Id="PurgeQuery" Name="*.*" On="uninstall" />
<RemoveFolder Id="idDirQuery" On="uninstall" Directory="dirQuery" />
</Component>
<Directory Id="dirQueryOutput" Name="QueryOutput">
<Component Id="cmpDirQueryOutput" Guid="{####################################}">
<CreateFolder Directory="dirQueryOutput" />
<RemoveFile Id="PurgeQueryOutput" Name="*.*" On="uninstall" />
<RemoveFolder Id="idDirQueryOutputRemove" On="uninstall" Directory="dirQueryOutput" />
</Component>
</Directory>
<Component Id="cmpQueryExe" Guid="*">
<File Id="filQueryExe" KeyPath="yes" Source="$(var.SourceDir)\Query.exe" />
<RemoveRegistryKey Id="RemoveQueryRegKey" Root="HKLM" Key="####################################" Action="removeOnUninstall" />
</Component>
<Component Id="cmpQueryPdb" Guid="*">
<File Id="filQueryPdb" KeyPath="yes" Source="$(var.SourceDir)\Query.pdb" />
</Component>
<Component Id="cmpBusinessLogicDll" Guid="*">
<File Id="filBusinessLogicDll" KeyPath="yes" Source="$(var.SourceDir)\BusinessLogic.dll"/>
</Component>
<Component Id="cmpBusinessLogicPdb" Guid="*">
<File Id="filBusinessLogicPdb" KeyPath="yes" Source="$(var.SourceDir)\BusinessLogic.pdb" />
</Component>
<Component Id="cmpBusinessObjectDll" Guid="*">
<File Id="filBusinessObjectDll" KeyPath="yes" Source="$(var.SourceDir)\BusinessObject.dll" />
</Component>
<Component Id="cmpBusinessObjectPdb" Guid="*">
<File Id="filBusinessObjectPdb" KeyPath="yes" Source="$(var.SourceDir)\BusinessObject.pdb" />
</Component>
<Component Id="cmpCommonDll" Guid="*">
<File Id="filCommonDll" KeyPath="yes" Source="$(var.SourceDir)\Common.dll" />
</Component>
<Component Id="cmpCommonPdb" Guid="*">
<File Id="filCommonPdb" KeyPath="yes" Source="$(var.SourceDir)\Common.pdb" />
</Component>
<Component Id="cmpDataAccessDll" Guid="*">
<File Id="filDataAccessDll" KeyPath="yes" Source="$(var.SourceDir)\DataAccess.dll" />
</Component>
<Component Id="cmpDataAccessPdb" Guid="*">
<File Id="filDataAccessPdb" KeyPath="yes" Source="$(var.SourceDir)\DataAccess.pdb" />
</Component>
<Component Id="cmpDPAPIHelperDll" Guid="*">
<File Id="filDPAPIHelperDll" KeyPath="yes" Source="$(var.SourceDir)\DPAPIHelper.dll" />
</Component>
<Component Id="cmpDPAPIHelperPdb" Guid="*">
<File Id="filDPAPIHelperPdb" KeyPath="yes" Source="$(var.SourceDir)\DPAPIHelper.pdb" />
</Component>
<Component Id="cmpLoggerDll" Guid="*">
<File Id="filLoggerDll" KeyPath="yes" Source="$(var.SourceDir)\Logger.dll" />
</Component>
<Component Id="cmpLoggerPdb" Guid="*">
<File Id="filLoggerPdb" KeyPath="yes" Source="$(var.SourceDir)\Logger.pdb" />
</Component>
<Component Id="cmpPSALERTSIni" Guid="*">
<File Id="filPSALERTSIni" KeyPath="yes" Source="$(var.SourceDir)\PSALERTS.ini" />
</Component>
<Component Id="cmpPSALERTSXltm" Guid="*">
<File Id="filPSALERTSXltm" KeyPath="yes" Source="$(var.SourceDir)\PSALERTS.xltm" />
</Component>
<Component Id="cmpPSALERTSUserGuideChm" Guid="*">
<File Id="filPSALERTSUserGuideChm" KeyPath="yes" Source="$(var.SourceDir)\PSALERTSUserGuide.Chm" />
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
</Fragment>
</Wix>
Set the ARPSYSTEMCOMPONENT to 0. You can add the following line under your < Package ... > line.
<Property Id="ARPSYSTEMCOMPONENT">0</Property>
https://msdn.microsoft.com/en-us/library/windows/desktop/aa367750(v=vs.85).aspx
I want to add a shortcut in my program menu. i tried:
<Component Id='myId' Guid='E4DED108-0129-4a5b-83FE-C9D1E3025B00'>
<File Id='MyFileID' Name='Prog.exe' DiskId='1' Source='.\Prog.exe' KeyPath='yes'>
<Shortcut Id='myShortcut' Name='Prog' Icon='MyIcon.exe' IconIndex='0' Directory='ProgramMenuDir' Advertise='yes' />
</File>
</Component>
but the installer add the shortcut in a subfolder in the program menu! Why and what can i do to avoid this?
Thanks Micha
You can try to change Directory='ProgramMenuDir' into Directory='ProgramMenuFolder', otherwise make a seperate shortcuts component;
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramMenuFolder">
<Component Id="Shortcuts" Guid="{}">
<Shortcut Id='myShortcut' Name='Prog' Icon='MyIcon.exe' IconIndex='0' Directory='ProgramMenuFolder' WorkingDirectory='INSTALLDIR' Target="[INSTALLDIR]Prog.exe" />
<RegistryValue Root='HKCU' Key='SOFTWARE\prog\prog' Type='string' Value='1' KeyPath='yes' />
</Component>
</Directory>
<!-- other files -->
</Directory>