I am attempting to build an installer with wix.
It compiles and runs. Unfortunately when I run it, I accept the license agreement and hit next, then it explodes.
Error
"The installer has encountered an unexpected error installing this
package. This may indicate a problem with this package. The error code
is 2819."
Here is the code I am using
Code
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="rd Installer" Language="1033" Version="1.0.0.0" Manufacturer="hs" UpgradeCode="upgradeCode">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="rd">
<Directory Id="BINFOLDER" Name="Bin"/>
<Directory Id="IMAGEFOLDER" Name="Image"/>
</Directory>
</Directory>
</Directory>
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="CMP_rd1" Guid="guid">
<File Id="rd1"
Name="r.d"
Source="D:\dir\file.txt"
KeyPath="yes">
</File>
</Component>
<Component Id="CMP_rd2" Guid="guid">
<File Id="rd2"
Name="r.d"
Source="D:\dir\file.txt"
KeyPath="yes">
</File>
</Component>
</DirectoryRef>
<Feature Id="DefaultFeature" Level="1">
<ComponentRef Id="CMP_rd1"/>
<ComponentRef Id="CMP_rd2"/>
</Feature>
<UI Id="UI_ReportDasboard">
<UIRef Id="WixUI_InstallDir"/>
</UI>
</Product>
</Wix>
I've looked at a number of examples and I cant seem to understand what's wrong. My code looks very close to the examples I've seen. Am I missing something?
You need to set the WIXUI_INSTALLDIR property.
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
More info here
I was receiving the error 2819 having
<Control Id="SelectWebSiteList" Type="ListBox" X="20" Y="75" Width="200" Height="150" Sorted="yes" Property="WEBSITE" />
without
Property="WEBSITE"
Related
actually I just started learning wix today from the http://wixtoolset.org/documentation/
after reading and learning few things I got some confidence to start creating my first wix project and the configuration for the same is here:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="PersonalDailyInstaller" Language="1033" Version="1.0.0.0"
Manufacturer="Muhammad Sufiyan Shaikh" UpgradeCode="1327de13-b713-4cee-9778-be9c7460c0aa">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<!-- <MediaTemplate EmbedCab="yes" /> -->
<Feature Id="ProductFeature" Title="PersonalDailyInstaller" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="PersonalDaily" />
</Directory>
</Directory>
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="MainExe" Guid="D7DC3991-2EE4-4BE5-B8B4-D15AC05592F3">
<File Id="MainExe" Source="bin\Debug\PersonalDaily.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="DataPD" Guid="9DF21E80-F608-416A-BBAE-92AB3DA4CAE6">
<File Id="DataPD" Source="bin\Debug\data.PD" KeyPath="yes" Checksum="yes"/>
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="ProductComponent">
<File Source="$(var.PersonalDaily.TargetPath)" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
now when I build the wix project I am getting below error:
Severity Code Description Project File Line Suppression State
Error Found orphaned Component 'MainExe'. If this is a Product, every Component must have at least one parent Feature. To include a Component in a Module, you must include it directly as a Component element of the Module element or indirectly via ComponentRef, ComponentGroup, or ComponentGroupRef elements. PersonalDailyInstaller C:\Users\muham\documents\visual studio 2015\Projects\PersonalDaily\PersonalDailyInstaller\Product.wxs 25
any help or work around would be a great help for me. thanks in advance.
thanks everyone, actually I got it working by doing some changes and experiment on it, and updated working code is here:
and yes for sure, If anyone has better approach then this please post your answer...
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="PersonalDailyInstaller" Language="1033" Version="1.0.0.0"
Manufacturer="Muhammad Sufiyan Shaikh" UpgradeCode="1327de13-b713-4cee-9778-be9c7460c0aa">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<!-- <MediaTemplate EmbedCab="yes" /> -->
<Feature Id="ProductFeature" Title="PersonalDailyInstaller" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="Dlls" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="PersonalDaily" />
</Directory>
</Directory>
<ComponentGroup Id="Dlls" Directory="INSTALLFOLDER">
<Component Id="DataPD" Guid="9DF21E80-F608-416A-BBAE-92AB3DA4CAE6">
<File Id="DataPD" Source="..\PersonalDaily\bin\Debug\data.PD" KeyPath="yes" Checksum="yes"/>
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="ProductComponent">
<File Source="$(var.PersonalDaily.TargetPath)" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
I want to ship file to our target folder and create shortcut to desktop folder.my wix coding is
enter code here`
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="5A157ECF-D387-43EF-855E-C39E9F26B463" Name="DesktopPermission" Language="1033" Version="1.0.0.0" Manufacturer="Naveen" UpgradeCode="5A157ECF-D387-43EF-855E-C39E9F26B463">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="DesktopPermission" Level="1">
<ComponentRef Id="compid"/>
</Feature>
<DirectoryRef Id="APP_DIR">
<Component Id="compid" Guid="F2450B59-EA82-4762-8AEF-984D54F6EAA9">
<File Id="BuildFile" KeyPath="yes" Source="C:\Users\naveen.raja\Desktop\Text.txt"/>
</Component>
</DirectoryRef>
<CustomAction Id="sample" Directory="APP_DIR" Value="C:\Users\naveen.raja\Desktop\Installone" Execute="immediate" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="APP_DIR" Name="myfile">
</Directory>
</Directory>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="DesktopFolder" Name="Desktop">
<Component Id="ApplicationShortcutDesktop" Guid="258B1044-131B-49F7-90CB-CC92C8658191">
<Shortcut Id="ApplicationDesktopShortcut"
Name="Text under your icon"
Description="Comment field in your shortcut"
Target="[APP_DIR]"
WorkingDirectory="APP_DIR"/>
<RemoveFolder Id="DesktopFolder" On="uninstall"/>
<RegistryValue
Root="HKCU"
Key="Software/MyAppName"
Name="installed"
Type="integer"
Value="1"
KeyPath="yes"/>
</Component>
</Directory>
</Directory>
</Product>
<Fragment>
<InstallExecuteSequence>
<Custom Action="sample" Sequence="600" />
</InstallExecuteSequence>
</Fragment>
</Wix>
but the file not shipped and also not created the shortcut. so please help what are all things to change in this coding. Thanks in advance.
Normally, if you provide a verbose log of your installation, it makes it easier to see exactly what went wrong. Without that log, I had to go with your code only.
Your code as provided didn't compile for me (I am using v3.9), and there were other errors in form probably preventing your installer from running as you intended. The errors I found were of the following types:
1: your custom action to set the location of APP_DIR wasn't ever included because the fragment scheduling it was never referenced. That would cause the file to be installed to C:\myfile\Text.txt (replace C: with the drive with the largest amount of free space on your computer) instead of under your desktop as you intended. (May your file be there?)
2: Code failed ICE21 because ApplicationShortcutDesktop wasn't included in any feature (probable reason that your shortcut didn't appear).
3: Code couldn't compile because was repeated.
4: Code failed ICE 12 because your custom action "sample" is of type: 35. Therefore it must come after CostFinalize # 1000 in Seq Table: InstallExecuteSequence.
A side note: Normally ProductCode (Product\#Id) and UpgradeCode (Product\#Upgrade) are NOT the same value. You may wish to learn more about those two values in Windows Installer/MSI. There are a lot of experts in this area on the wix toolset's wix-users list. In fact, a lot of help can be found by searching that lists archives and/or by asking questions there.
Fixing these four errors, your file's folder and your shortcut to the file's folder both showed up on the indicated desktop, and the file was found added to that folder.
Here's what my version (minimal changes) of your code looks like:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="5A157ECF-D387-43EF-855E-C39E9F26B463" Name="DesktopPermission" Language="1033" Version="1.0.0.0" Manufacturer="Naveen" UpgradeCode="5A157ECF-D387-43EF-855E-C39E9F26B463">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="DesktopPermission" Level="1">
<ComponentRef Id="compid"/>
<ComponentRef Id="ApplicationShortcutDesktop"/>
</Feature>
<DirectoryRef Id="APP_DIR">
<Component Id="compid" Guid="F2450B59-EA82-4762-8AEF-984D54F6EAA9">
<File Id="BuildFile" KeyPath="yes" Source="C:\Users\naveen.raja\Desktop\Text.txt"/>
</Component>
</DirectoryRef>
<CustomAction Id="sample" Directory="APP_DIR" Value="C:\Users\naveen.raja\Desktop\Installone" Execute="immediate" />
<InstallExecuteSequence>
<Custom Action="sample" After="CostFinalize" />
</InstallExecuteSequence>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="APP_DIR" Name="myfile">
</Directory>
</Directory>
<DirectoryRef Id="TARGETDIR">
<Directory Id="DesktopFolder" Name="Desktop">
<Component Id="ApplicationShortcutDesktop" Guid="258B1044-131B-49F7-90CB-CC92C8658191">
<Shortcut Id="ApplicationDesktopShortcut"
Name="Text under your icon"
Description="Comment field in your shortcut"
Target="[APP_DIR]"
WorkingDirectory="APP_DIR"/>
<RemoveFolder Id="DesktopFolder" On="uninstall"/>
<RegistryValue
Root="HKCU"
Key="Software/MyAppName"
Name="installed"
Type="integer"
Value="1"
KeyPath="yes"/>
</Component>
</Directory>
</DirectoryRef>
</Product>
</Wix>
Hope that helps!
i am trying to add files in my WIX installer, however it doesn't do that at the moment. i am staring at it for hours now and i just can't see what might be the problem. the referencing seems to work alright as well as the target location. the installer runs fine up to the point when it needs to install files of course.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Wix_setup" Language="1033" Version="1.0.0.0" Manufacturer="Frank Jansen" UpgradeCode="37a42e55-dea8-47da-8f4f-fb065dd38a9e">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes"/>
<Feature Id="ProductFeature" Title="Wix_setup" Level="1">
<!--create a seperate ComponentGroupRef and Fragment for each extra added program-->
<ComponentGroupRef Id="InstallationFiles" />
<ComponentGroupRef Id="DLLs" />
<ComponentGroupRef Id="IniFiles" />
<ComponentGroupRef Id="Scripts" />
<ComponentGroupRef Id="TeamViewer" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="Wix_setup" />
</Directory>
</Directory>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" ></Property>
<UIRef Id="WixUI_InstallDir"/>
</Fragment>
here is also a part of the references that i made using heat:
<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<Directory Id="dirE31AF1F0EC087256AE3A304B079577CE" Name="Program Files">
<Directory Id="dir686DC70E77279FD983277BA8C61F0AF5" Name="ActiveX Control Pad">
<Component Id="cmp50E37DF3A2B94BC9155ED7F4A264B47B" Guid="{F3CE58FB-5E41-4CD9-B761-C1B14A4F6C5F}">
<File Id="fil0D955E35C33B26A36350F0C4D02733AF" KeyPath="yes" Source="C:\Users\fjansen\Documents\MMI installatie bestanden\MMI install files\Program Files\ActiveX Control Pad\license.txt" />
</Component>
<Component Id="cmp367C764B6CFEC27E7632FB3F5B37A3F9" Guid="{FBEC3C91-3DCD-4CF3-B58D-B7C97AEB8ACF}">
<File Id="fil084E5B485699543BB060A10BAEEC4519" KeyPath="yes" Source="C:\Users\fjansen\Documents\MMI installatie bestanden\MMI install files\Program Files\ActiveX Control Pad\ped.cnt" />
</Component>
<Component Id="cmp5EF25EC501B2689546C69D7C8B18B79F" Guid="{182C17ED-01E1-4529-A733-D3FBA7FF61EE}">
<File Id="filF5043624868A85726914B5A383640B6F" KeyPath="yes" Source="C:\Users\fjansen\Documents\MMI installatie bestanden\MMI install files\Program Files\ActiveX Control Pad\PEd.exe" />
</Component>
<Fragment>
<ComponentGroup Id="Wix_database" Directory="INSTALLFOLDER" >
<ComponentRef Id="cmp50E37DF3A2B94BC9155ED7F4A264B47B" />
<ComponentRef Id="cmp367C764B6CFEC27E7632FB3F5B37A3F9" />
<ComponentRef Id="cmp5EF25EC501B2689546C69D7C8B18B79F" />
the ComponentGroupRef's and the Fragments they are connected to are currently not yet in use and dont have an impact on the program (the Fragments are left out of this example)
can anybody see what i might have done wrong or what is missing?
thanks in advance,
i have solved the errors. it had a conflict with my reference file i still had in the project, because of that it did see it as two references to the same symbol that i declared the way heavyd suggested.
thanks for the support Heavyd.
Enviorment:Win7+VS2012+Wix3.7.
Complile error:
Unresolved reference to symbol 'WixUI:WixUI_InstallDir' in section
'Product:{9E327731-0EAC-4A02-9C3C-9C136ACCE05B}'
Code is the follow:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="{9E327731-0EAC-4A02-9C3C-9C136ACCE05B}" Name="SetupProject2" Language="1033" Version="1.1.1.1" Manufacturer="Anser" UpgradeCode="61eb40a6-21d9-4f23-9c9e-078b98707371">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="SetupProject2" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<Property Id="WIXUI_INSTALLDIR">INSTALLDIR</Property>
<UIRef Id="WixUI_InstallDir"/>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="SetupProject2" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<!-- <Component Id="ProductComponent"> -->
<!-- TODO: Insert files, registry keys, and other resources here. -->
<!-- </Component> -->
<Component Id="ProductComponent" DiskId="1" Guid="{65F464D6-BC0B-4679-9546-CF8B6CFCE184}">
<File Name='test.exe' Source="test.exe" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
I can't find the reason.Who can help me?
Reference WixUIExtension.dll in the project.
I refer to the similar question in the follow site.
How to add a UI to a WiX 3 installer?
I am having trouble understanding wix documentation. I have created a simple installer that allows user to select a destination folder for app. It looks something like this:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="AppName" Language="1033" Version="1.0.0.0" Manufacturer="Manufacturer" UpgradeCode="guid">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="SetupProjectFeature" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<UIRef Id="WixUI_InstallDir"/>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="OeeCoach" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Insert files, registry keys, and other resources here. -->
<Component Id="EntityFramework" Guid="guid">
<File Id="EntityFramework.dll" Source="../App/bin/Release/EntityFramework.dll" KeyPath="yes" />
</Component>
<Component Id="MvvmLight.Extras" Guid="guid">
<File Id="GalaSoft.MvvmLight.Extras.WPF4.dll" Source="../App/bin/Release/GalaSoft.MvvmLight.Extras.WPF4.dll" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
Now I need to check for .net 4 and its prerequisites, but I could not understand hot to do this. Documentation says that I need to use Bundle element, but compiler seems to complain when it is together with Product element in same wix file.
Any help is appreciated.
The bootstrapper is a separate project from your setup project. If you are using Visual Studio, add a new project to your solution and choose Bootstrapper project (instead of Setup project).