1. It doesn't surprise me that you need to define SystemFolder in the
Directory table. That's easy enough to do. Just make it a child of the
TARGETDIR Directory element and you're done.
2. Yes, "fun" for me can often equate to "loony bin" for others. The trick is
getting the Windows Installer to do its native actions on uninstall (which it
doesn't do in many cases). That does mean you're stuck with a CustomAction.
The problem with CustomActions is that you then assume responsibility for
install/uninstall/rollback/patching/upgrading/etc. You can condition out some
of those cases (like install in your case) but what about rollback for
uninstall?
When anyone says, "I'll just write a CustomAction!" I usually end up smiling.
Teams (mostly in Microsoft since those are the halls I haunt) that know me well
know they are in deep trouble when I start smiling like that because they know
they oversimplified something. Simplifying your applications installation
needs is a very good thing. Oversimplifying your setup means customers feel
the pain when things don't go simply (like the user hits an error or even the
cancel button).
<smile/>
From: Josh Pepper [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 03, 2007 9:53 AM
To: Rob Mensching; wix-users@lists.sourceforge.net
Subject: RE: [WiX-users] Trying to use a system property in a property
Thanks for the response!
Why am I putting stuff in the SystemFolder? I am editing the usrlogon.cmd and
usrlogn2.cmd scripts. We do some scripting upon logon. This is actually part
of a deployment to spin up a Citrix server in a farm. I won't be shipping this
product; this is an installer I am writing to help my comrades on the
operations side of IT at our company out a bit.
Great! OK, so I can put SystemFolder in the CopyFile/@SourceProperty ... ok
... doing that .... SourceProperty='SystemFolder' ... ok so I do that, run the
install on my Virtual box, and I get the message "The installer has encounted
an unexpected error installing this package. This may indicate a problem with
this package. The error code is 2727."
Then, if I look in the log I see:
...stuff...
Action start 11:43:18: InstallValidate.
DEBUG: Error 2727: The directory entry 'SytemsFolder' does not exist in the
Directory table
...other stuff...
Hm. So it's looking in the Directory table? OK, so I ran Orca and looked at
the Directory table. Of course, I only see there the things that I explicitly
defined, SystemFolder not being one of them. To be this seems to be an issue
of timing; am I trying to access SystemFolder before the nth level of magic is
invoked to replace it with C:\\Windows\System32 (or whatever)?
>> 3. You're going to have a fun time trying to put the files back on uninstall.
Uh.... Is this what they call foreboding? When installer gurus say something
is "fun" that usually translates to a trip to the loony bin for the rest of us.
I hadn't quite figured it out yet, but all I am trying to do is on install,
make a backup of some scripts, and on uninstall, grab those backups and put
them back where I found them. There is no way to do this? Couldn't I make
some (stretching here, beyond my knowledge) CustomAction, and have it only run
on uninstall? On='uninstall' or something? No?
Thanks!
Josh
Josh Pepper
Software Developer
MinuteClinic
________________________________
From: Rob Mensching [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 03, 2007 11:18 AM
To: Josh Pepper; wix-users@lists.sourceforge.net
Subject: RE: [WiX-users] Trying to use a system property in a property
0. Why are you putting stuff in SystemFolder? That's part of the operating
system. Generally not a place people outside of the Windows team should be
messing with.
1. Property values do not resolve the Properties in them. In your case, your
"SysFolder" property contains the actual value "[SystemFolder]". That will not
be resolved to C:\Windows\System32 (or whatever). To get the resolution
behavior you need to use a CustomAction... Type51 is the easiest.
2. In your case, you shouldn't even need to set "SysFolder". Just putting
"SystemFolder" in the CopyFile/@SourceProperty should work... haven't tried it
so there may be a gotcha in there.
3. You're going to have a fun time trying to put the files back on uninstall.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Josh Pepper
Sent: Friday, March 02, 2007 1:16 PM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Trying to use a system property in a property
Hi all -
I am having some trouble using a system property. My current goal is to make a
backup copy of some *.cmd files in the System32 directory because on
installation I will be overwriting them (and then on uninstall I will be
restoring the backups, but I am not there yet).
My current problem is that I get a "Error 1314. The specified path
'[SystemFolder]' is unavailable" error when I run the MSI.
I am just trying to use the CopyFile element to copy the file usrlogon.cmd to
my install dir. Some questions:
1. It seems I can refer to a system property such as ProgramFilesFolder in an
Id without enclosing it in braces. How is this the case?
2. When I run the msi that the following XML creates, I get "Error 1314. The
specified path '[SystemFolder]' is unavailable" in the log. Is the property
getting defined at a time when I cannot refer to system properties?
3. When and where can I refer to things like ProgramFilesFolder and
SystemFolder? When should I enclose in braces and when should I not?
4. You can see below that I attempted to define a property with a value of
[SystemFolder]. That didn't work. However, neither did putting SystemFolder
or [SystemFolder] in any of the places that I wanted that value (such as
SourceDirectory in the CopyFile element). Why is this?
<?xml blah><Wix blah><Product blah><Package blah /><Media blah />
<Property Id='DiskPrompt' blah />
<Property Id="SysFolder" Value ='[SystemFolder]' />
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='MinuteClinic' Name='MCDir' LongName='MinuteClinic Folder
Long Name'>
<Directory Id='INSTALLDIR' Name='SLDir' LongName='Server Logon Folder
Long Name'>
<Component Id='BackupCmds'
Guid='A004C7F0-0585-4728-9F3C-C2C402549D7A'>
<CopyFile Id="CopyUsr" Delete="no"
SourceProperty='SysFolder' SourceName="usrlogon.cmd"
DestinationDirectory="INSTALLDIR"
DestinationName="usrlogon.bak" DestinationLongName="usrlogon.cmd.bak"/>
</Component></Directory></Directory></Directory>
<Feature Id='Complete' Level='1'>
<ComponentRef Id='BackupCmds' />
</Feature> </Product></Wix>
Many thanks to all who respond!
Josh Pepper
Software Developer
MinuteClinic
This electronic mail message and attachments contain
information which may be (a) LEGALLY PRIVILEGED,
CONFIDENTIAL AND PROPRIETARY IN NATURE, OR
OTHERWISE PROTECTED BY LAW FROM DISCLOSURE,
and is (b) intended only for the use of the Addressee(s)
named herein. If you are not the Addressee(s), or the person
responsible for delivering this message to the Addressee(s),
you are hereby notified that reading, copying, or distributing
this message is prohibited. If you have received this
electronic mail message in error, please contact us
immediately (by reply e-mail) to inform us of the error and
take the steps necessary to delete the message completely
from your computer system and any related data. Thank you.
This electronic mail message and attachments contain
information which may be (a) LEGALLY PRIVILEGED,
CONFIDENTIAL AND PROPRIETARY IN NATURE, OR
OTHERWISE PROTECTED BY LAW FROM DISCLOSURE,
and is (b) intended only for the use of the Addressee(s)
named herein. If you are not the Addressee(s), or the person
responsible for delivering this message to the Addressee(s),
you are hereby notified that reading, copying, or distributing
this message is prohibited. If you have received this
electronic mail message in error, please contact us
immediately (by reply e-mail) to inform us of the error and
take the steps necessary to delete the message completely
from your computer system and any related data. Thank you.
-------------------------------------------------------------------------
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
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users