Wix Installer
Author
Discussion

him_over_there

Original Poster:

970 posts

236 months

Tuesday 6th April 2010
quotequote all
Anyone here work with WiX ?

I'm trying to create an installer but I'm having trouble specifying a path to install.

I have:


<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder'>
<Directory Id='INSTALLDIR' Name='PACKAGEXYZ'>
... blah blah blah ...
</Directory>
</Directory>
</Directory>


Which installs it to Program Files/PACKAGEXYZ

What I want to do though is install it Program Files/Company Name/PACKAGEXYZ so that all our packages are installed to a the Company Name folder.

e.g.

Program Files/Company Name/Package ABC
Program Files/Company Name/Package XYZ

Anyone know how I specify this as It doesn't like me using slashes in the path name.

Arese

21,373 posts

217 months

Tuesday 6th April 2010
quotequote all
Shouldn't it be a \ and not a / ?

him_over_there

Original Poster:

970 posts

236 months

Tuesday 6th April 2010
quotequote all
Arese said:
Shouldn't it be a \ and not a / ?
I got my slashes mixed up, like I always do. However it likes neither.

I've tried now:



<Property Id="MYAPPPATH"><![CDATA[Company Name\Package Name]]></Property>

<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder'>
<Directory Id="MYAPPPATH" Name=".">
<Directory Id="MYINSTALLDIR" Name="Pckage Name">
<Component Id='MainExecutable' Guid="E309FF19-5E81-492c-962D-ADDF1AA262F7">
<CreateFolder Directory='QMINSTALLDIR'/>
<File Id ="MainExecutable" Name="myexe.exe"
Source="myexe.exe" Vital="yes"/>

<RemoveFolder Id="MYINSTALLDIR" On ="uninstall"/>
</Component>
</Directory>
</Directory>
</Directory>
</Directory>


That wants to install to

Company Name\Package Name

I can't find how to make it

%System Drive%\Program Files\Company Name\Package Name without hardcoding it to the local drive. The %System Drive%\Program Files may not be on the local drive.

Edited by him_over_there on Tuesday 6th April 15:06

pdV6

16,442 posts

291 months

Tuesday 6th April 2010
quotequote all
Not an expert in WiX by any means but looking at one here that somebody else put together, should it look something like this?


<Product Id="<guid>" Manufacturer="Company Name plc" Name="Company Name" UpgradeCode="<guid>" Version="<x.y>">
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" SourceName="program files">
<Directory Id="COMPANY_NAME_FOLDER" Name="Company Name">
<Directory Id="MY_PRODUCT_NAME" Name="PackageXYZ">
</Directory>
</Directory>
</Directory>
</Directory>
</Product>


him_over_there

Original Poster:

970 posts

236 months

Tuesday 6th April 2010
quotequote all
Thanks, yes that works.

It's obvious really, I don't know why I was trying to over complicate it with pulling the company name from a variable.

Woods for the trees I guess banghead

TonyToniTone

3,928 posts

279 months

Tuesday 6th April 2010
quotequote all
You will probably want to set the ROOTDRIVE=C:\ property if it has to default to %SystemDrive% otherwise it will default to the drive with the most space.

him_over_there

Original Poster:

970 posts

236 months

Wednesday 7th April 2010
quotequote all
Thanks,

I have it working here. It installs the files, does the registry stuff, creates shortcuts in the start menu, custom looking dialogue boxes etc

It also checks for .NET being installed and if it isn't it installs it using a bootstrapper.

Is their anyway I can test this, all the machines here have .NET installed! I'm hoping there is an easier way than installing windows on a VM and testing it there ??

Help appreciated smile

pdV6

16,442 posts

291 months

Wednesday 7th April 2010
quotequote all
VMs are your friend, I'm afraid.

Do a clean install of whichever Windows flavour you're interested in and then back it up / take a snapshot / make a copy of the VHD (depending on which VM system you're using) so you can return to a "clean" state easily, 'cos you're bound to need to re-test umpteen times in my experience!

TonyToniTone

3,928 posts

279 months

Wednesday 7th April 2010
quotequote all
to do a quick test you could rename the registry keys it looks for but I would still follow pdV6 advise.
http://blogs.msdn.com/astebner/archive/2008/11/11/...


him_over_there

Original Poster:

970 posts

236 months

Thursday 8th April 2010
quotequote all
hmm.

I installed a VM and tested it all. It installs .NET if needed, packages can be installed / uninstalled. Updates successfully check for previous versions before installing and either install new version and remove old version or fail with an error that it couldn't find a product to update (which is what I want, it means i can distribute patches without worrying about people not having the original product installed.) Before I was packing the msi in a .exe and manually looking for installed previous versions and checking they were legitimate and then unpacking the msi, installing it and deleting the msi.

Products also uninstall cleanly.

It all seems to work perfectly fine, which worries me for a few reasons:

1. Nothing I ever test works first time.
2. Only known about Wix for a few days.
3. It looks like it should be a lot more complicated than it is.
4. I'm not very bright.

hehe

Taita

8,008 posts

233 months

Thursday 8th April 2010
quotequote all
Stop! Beta time!

DO DO DEE DEE DO!!

pdV6

16,442 posts

291 months

Thursday 8th April 2010
quotequote all
There's definitely something wrong, then! Installations are the worst part of development and never work right first time!

In the hope that you've covered all the bases... congratulations!

As an aside, I really need to get into WiX; everybody who's switched to using it has (almost) nothing but praise for it.