Some time ago I also needed a similar functionality (read a path from
Registry and then go 2 levels up that path), but wasn't able to achieve
that with the standard Wix means, so I ended up writing a Custom Action
- just a simple VB script that reads the registry, parses the path to
the format that you need, and then sets the property with
Session.Property("VS2005_VCPROJECTS_DIR") = cleanedPath

 

Levon

 

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bruce
Belson
Sent: Wednesday, August 08, 2007 6:02
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] How to remove a redundant ".\" from a directory
name?

 

Is there a way to remove a redundant ".\" from a directory name which is
read from the registry.


Here's the detail:- I need to find the VC projects directory in Visual
Studio 2005. 

I look in the registry key as follows:

    <Property Id="VS2005_VCPROJECTS_DIR">
      <RegistrySearch Id="SearchForVCProjectsDir" Root="HKLM"
Key="SOFTWARE\Microsoft\VisualStudio\8.0\Projects\{8BC9CEB8-8B4A-11D0-8D
11-00A0C91BC942}" 
          Name="ProjectTemplatesDir" Type="directory"/>
    </Property>

Unfortuately, the path in the registry has a redundant ".\" as follows:

    C:\Program Files\Microsoft Visual Studio 8\VC\.\VCProjects

When I run the search, VS2005_VCPROJECTS_DIR is set to "C:\" and the
following error is written to the log:

    AppSearch: Property: VS2005_VCPROJECTS_DIR, Signature:
SearchForVCProjectsDir
    Info 1324. The folder path '.' contains an invalid character.

If I change RegistrySearch/@Type to "raw", then I correctly get in the
log:

    VS2005_VCPROJECTS_DIR = C:\Program Files\Microsoft Visual Studio
8\VC\.\VCProjects

However, the following lines blow up instead:

    <DirectoryRef Id="TARGETDIR">
      <Directory Id="VS2005_VCPROJECTS_DIR" Name=".">
      </Directory>
    </DirectoryRef>

and this error message comes up: "The error "The folder path '.'
contains an invalid character".

Is there some way to transform "C:\Program Files\Microsoft Visual Studio
8\VC\.\VCProjects" to "C:\Program Files\Microsoft Visual Studio
8\VC\VCProjects" before it gets assigned to the Dircetory element?

I'm using wix-3.0.2420.0. I hope someone can help on this. I suspect
there is a simple solution which more learned MSI users will know.

Thanks,
Bruce

  

________________________________

Yahoo!7 Mail has just got even bigger and better with unlimited storage
on all webmail accounts. Find out more
<http://au.docs.yahoo.com/mail/unlimitedstorage.html> .



**************************************************************************
READER BEWARE: Unencrypted, unsigned Internet e-mail is inherently insecure.

Internet messages may be corrupted, incomplete, misdirected or may
incorrectly identify the sender. Therefore, nothing in this message or
attachments may be considered legally binding.

THIS MESSAGE IS ONLY INTENDED FOR THE USE OF THE INDIVIDUAL
OR ENTITY TO WHICH IT IS ADDRESSED AND MAY BE PRIVILEGED.

If you are not the intended recipient or their authorized agent, you
may not forward or copy this information and must delete or destroy all
copies of this message and attachments received.

If you have received this communication in error, please notify
Matrikon Inc. by telephone at (780) 448-1010.
**************************************************************************
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to