Discussion:
[WiX-users] Accessing the Source Directory
Geoff Finger
2007-03-22 22:45:01 UTC
Permalink
I've been trying to figure out how to copy some files located in the
directory the msi file is being run from to the Install directory, the
big problem being that I couldn't find an easy way to fetch the value
of the source directory.

SourceDir leads to the root of the drive and CURRENTDIRECTORY isn't
accessible through Wix. Searching through the archives let to a lot of
suggestions involving the msi property OriginalDatabase, however that
includes the file name so there is the added complication of writing a
custom action to strip that off.

While looking through the log files after some experiments however I
noticed that SourceDir starts at the actual Source directory before
being truncated to just the root. I managed to use the following
custom action to grab the value before the truncation happens:

<CustomAction Id="ResetSetupDir" Property="SETUPDIR" Value="[SourceDir]" />

and in AdminUISequence:

<Custom Action="ResetSetupDir" Before="ExecuteAction">NOT Installed</Custom>

Since I didn't see that suggestion in response to any of the previous
similar questions I thought it might be useful to share.
Rob Mensching
2007-03-23 00:28:16 UTC
Permalink
Why are you copying files from the original media instead of just using the File element?

-----Original Message-----
From: wix-users-***@lists.sourceforge.net [mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Geoff Finger
Sent: Thursday, March 22, 2007 3:45 PM
To: wix-***@lists.sourceforge.net
Subject: [WiX-users] Accessing the Source Directory

I've been trying to figure out how to copy some files located in the
directory the msi file is being run from to the Install directory, the
big problem being that I couldn't find an easy way to fetch the value
of the source directory.

SourceDir leads to the root of the drive and CURRENTDIRECTORY isn't
accessible through Wix. Searching through the archives let to a lot of
suggestions involving the msi property OriginalDatabase, however that
includes the file name so there is the added complication of writing a
custom action to strip that off.

While looking through the log files after some experiments however I
noticed that SourceDir starts at the actual Source directory before
being truncated to just the root. I managed to use the following
custom action to grab the value before the truncation happens:

<CustomAction Id="ResetSetupDir" Property="SETUPDIR" Value="[SourceDir]" />

and in AdminUISequence:

<Custom Action="ResetSetupDir" Before="ExecuteAction">NOT Installed</Custom>

Since I didn't see that suggestion in response to any of the previous
similar questions I thought it might be useful to share.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Anthony Wieser
2007-03-23 07:10:27 UTC
Permalink
From: "Rob Mensching" <***@microsoft.com>
To: "Geoff Finger" <***@gmail.com>; <wix-***@lists.sourceforge.net>
Sent: Friday, March 23, 2007 12:28 AM
Subject: Re: [WiX-users] Accessing the Source Directory
Post by Rob Mensching
Why are you copying files from the original media instead of just using the File element?
While I'm not the original poster on this, I considered doing the same, and was looking for a solution (though I've not implemented it).

I develop software which is distributed by a by a company who don't want a complicated build process. As a result, I've given them a directory tree which has my installer and autorun.inf, and a couple of folders that contain customer specific calibration files.

In addition, we support customizable language files, which are installed into these extra folders as well. All of these files are of the form: strings.XXX where XXX is the primary language identifier. As a result, I don't need to know (and in fact don't) exactly which files are being sent to customers, yet the installation just works.

Because it's built this way, my client doesn't need to have build tools installed on their PC. They just need to copy the customers calibration into the directory structure, and then copy the files to disk. Most of the installation remains unchanged, and therefore under version control.

I was considering building a custom action that copied all of the files across from the installation folder, but if there's a better way, I'd love to hear it.

Anthony Wieser
Wieser Software Ltd
Geoff Finger
2007-03-23 16:56:19 UTC
Permalink
Most of the files are made part of the installer using the File
element, however there are two files that are an exception for two
reasons.

First, they're both part of the readme file which we want users to be
able to access before they actually install the product. If it were
just that we could include the file both in the installer and on the
disk (though that seems slightly inelegant,) but the second reason is
because historically these two files have been changed hours or even
minutes before the actual release. Not that I think that's a very wise
policy, but it's not anything I have any control over.
Post by Rob Mensching
Why are you copying files from the original media instead of just using the File element?
-----Original Message-----
Sent: Thursday, March 22, 2007 3:45 PM
Subject: [WiX-users] Accessing the Source Directory
I've been trying to figure out how to copy some files located in the
directory the msi file is being run from to the Install directory, the
big problem being that I couldn't find an easy way to fetch the value
of the source directory.
SourceDir leads to the root of the drive and CURRENTDIRECTORY isn't
accessible through Wix. Searching through the archives let to a lot of
suggestions involving the msi property OriginalDatabase, however that
includes the file name so there is the added complication of writing a
custom action to strip that off.
While looking through the log files after some experiments however I
noticed that SourceDir starts at the actual Source directory before
being truncated to just the root. I managed to use the following
<CustomAction Id="ResetSetupDir" Property="SETUPDIR" Value="[SourceDir]" />
<Custom Action="ResetSetupDir" Before="ExecuteAction">NOT Installed</Custom>
Since I didn't see that suggestion in response to any of the previous
similar questions I thought it might be useful to share.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
Loading...