Click here to Skip to main content
15,901,666 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have had no experience with WIX before today, and I see that it's a very sophisticated
application where there is a lot to learn. What I'm trying to do is very simple,
and I've almost got what I want except for a few snags.

I am trying to create a WIX installation package for my WPF (native) application.

I've got the executable, along with the DLLs for the app to load.

It presents the user with the option as to where to install the app.

I've managed to get that much so far.


What I'm having trouble with is getting a folder with some text files to load
into the package, and have the installation create the folder with the files.

I also don't understand how to get the desktop icon onto the desktop.

Someone who has more experience with WIX could probably set me straight with
a few lines of code.

What I have tried:

XML
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
	<Product Id="*" Name="WPF_App_01" Language="1033" Version="1.0.0.0" Manufacturer="A_Soft" UpgradeCode="8582f421-5196-47d2-9c0a-5a5150dfa1fe">
		<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

		<MajorUpgrade DowngradeErrorMessage="A newer version of WPF_App_01 is already installed." />
		<MediaTemplate />

		<Feature Id="ProductFeature" Title="WPF_App_01" Level="1">
			<ComponentGroupRef Id="ProductComponents" />
		</Feature>

        <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" ></Property>
        <UIRef Id="WixUI_InstallDir"/>
    </Product>

	<Fragment>
		<Directory Id="TARGETDIR" Name="SourceDir">
			<Directory Id="ProgramFilesFolder">
				<Directory Id="INSTALLFOLDER" Name="WPF_App_01">
    				<Directory Id="DocFolder" Name="WPF_App_01_DOC"/>
    			</Directory>
			</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_01"  Guid="*"> 
				 <!--TODO: Insert files, registry keys, and other resources here.-->
                 <File Id="Install_WPF_App_01.exe"
                  Source="J:\Software_Development_02\WPF_App_01\bin\Release\WPF_App_01.exe"></File>
			 </Component> 
      
            <Component Id="ProductComponent_1" Guid="*">
                <File Id="BouncyCastle.Crypto.dll"
                        Source="J:\Software_Development_02\WPF_App_01\bin\Release\BouncyCastle.Crypto.dll"></File>
            </Component> 
            <Component Id="ProductComponent_2" Guid="*">
                <File Id="CSI_LIB_01.dll"
                        Source="J:\Software_Development_02\WPF_App_01\bin\Release\CSI_LIB_01.dll"></File>
            </Component>
            <Component Id="ProductComponent_3" Guid="*">
                <File Id="D_LIB_01.dll"
                        Source="J:\Software_Development_02\WPF_App_01\bin\Release\D_LIB_01.dll"></File>
            </Component> 

            <Component Id="ProductComponent_icon" Guid="*">
                <File Id="The_Icon_01.ico" Source="J:\Software_Development_02\WPF_App_01\The_Icon_01.ico"></File>
            </Component> 
       </ComponentGroup>
	
    </Fragment>
	
    <Fragment>


    <!-- This is where I'm going wrong. -->

    <ComponentGroup Id="ProductComponents_DOC" Directory="DocFolder">
			 <Component Id="ProductComponent_401" Guid="*"> 
                 <File Id="Demo_Projects.txt" KeyPath="yes"
                  Source="J:\Software_Development_02\WPF_App_01\bin\Release\aaa_Documentation\Demo_Projects.txt"></File>
			 </Component> 
			 <Component Id="ProductComponent_402" Guid="*"> 
                 <File Id="WPF_App_01_DOC.txt" KeyPath="yes"
                  Source="J:\Software_Development_02\WPF_App_01\bin\Release\aaa_Documentation\WPF_App_01_DOC.txt"></File>
			 </Component> 
       </ComponentGroup>
	</Fragment>

    <Fragment>
        <Icon Id="ProductComponent_icon" SourceFile="J:\Software_Development_02\WPF_App_01\The_Icon_01.ico"/>
    </Fragment>

</Wix>
Posted
Updated 13-Sep-16 3:07am
Comments
[no name] 12-Sep-16 14:30pm    
https://www.firegiant.com/wix/
http://www.codeproject.com/Tips/105638/A-quick-introduction-Create-an-MSI-installer-with
and you might try https://wixsharp.codeplex.com/wikipage?title=Building%20MSI%20with%20WixSharp%20%E2%80%93%20Step%20by%20step%20tutorial
wylbur 13-Sep-16 0:04am    
Thanks!

BTW: How do I mark this as the answer?
[no name] 13-Sep-16 9:08am    
You don't. It's comment not an answer.

1 solution

just do the basic tutorial on firegiant.com, they also show how to make program-menu entries and place desktop icons -
If you created MSI packages before it should be quite logical how wix works, if not it maybe a Little hard to understand why they do things like they do....
But is it possible that you use wix and havn't seen the tutorial? I'd suggest next time you lear a new technology don't try to be "productive" on day one - give time to make an example and understand the concepts...
 
Share this answer
 
Comments
wylbur 13-Sep-16 10:14am    
Hi Johannesnesltler

I've been going through the tutorial on firegiant and it's difficult to follow.

BTW: I've never created a MSI package, so I'm starting at square one.

I know how difficult it is to write tutorials for software that the author/developer
wrote themselves, as they have a very intimate knowledge of their product, and
don't always do a good job of explaining things in a way that people who have no clue
about their product can understand it.

I'm guilty of that myself. :-/

There are some better examples of WIX on CodeProject, and they should use them as a
starting point.

I've got the same post on MSDN, and someone has pointed out my problem:

https://social.msdn.microsoft.com/Forums/en-US/8ae58994-c851-48aa-8960-9a6a4996bbee/need-help-with-wix-installation-for-wpf-app?forum=wpf

THANKS!
johannesnestler 13-Sep-16 14:07pm    
your are absolutly right about tutorials... ;)
But good that you could solve your problem. I work with wix created installers for some time now, many things needed some fiddling and reading of the examples again and again - but most times only once - if you get how to do it, it seems easy later (How to start services, multilanguage-support, work with registry and custom dialogs, bootstrappers, ...) For me the main reason to use it (other than it's free) is source-control support (because of the simple textfiles) vs. Binary installers where you just see it's changed (on source control)...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900