none
CustomActionData - /TARGETDIR="[TARGETDIR] " Requires Trailing Space RRS feed

  • Question

  • This drives me crazy whenever I forget why there's a trailing space.

     

    TARGETDIR (or any other property that ends in "\") must not be located at the end of the parameter. It appears that some part of the installation process sees slash-quote and treats it as an escaped quote would be treated in a C++ string: "\"" == one double quote, not slash followed by quote.

     

    The result of omitting the space is usually a File Not Found exception:

     

    Code Block

    System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\WINDOWS\system32\Files\TriZetto\CareAdvance\TriZetto.CareAdvance.CreateCommandFile.dll' or one of its dependencies. The system cannot find the file specified..

     

     

    The actual TARGETDIR was "C:\Program Files\TriZetto\CareAdvance\". From the Windows Installer log:

     

    Code Block

    MSI (s) (C0:F4) [17:30:34:614]: PROPERTY CHANGE: Adding _731845D5_6872_46FD_82DC_C708B9386C31.install property. Its value is '/installtype=notransaction /action=install /LogFile= /TARGETDIR="C:\Program Files\TriZetto\CareAdvance\" "C:\Program Files\TriZetto\CareAdvance\TriZetto.CareAdvance.UMCaseConversion.CreateCommandFile.dll" "C:\TEMP\CFG72A.tmp"'.

     

     

    The workaround is to simply leave a space before the close quote.

     

    Monday, October 15, 2007 10:02 PM

Answers

  •  

    Hi John,

    Thank you for posting. I have read the document about this, and the document have already said that:

    Windows Installer properties can be passed using the bracketed syntax: /name=[PROPERTYNAME]. For Windows Installer properties such as [TARGETDIR] that return a directory, in addition to the brackets you must include quotation marks and a trailing backslash: /name="[TARGETDIR]\".

    If you feel this inconvenient, you can submit a suggestion on http://connect.microsoft.com/VisualStudio

    Best regards.
    Rong-Chun Zhang

    Wednesday, October 17, 2007 6:03 AM

All replies

  •  

    Hi John,

    Thank you for posting. I have read the document about this, and the document have already said that:

    Windows Installer properties can be passed using the bracketed syntax: /name=[PROPERTYNAME]. For Windows Installer properties such as [TARGETDIR] that return a directory, in addition to the brackets you must include quotation marks and a trailing backslash: /name="[TARGETDIR]\".

    If you feel this inconvenient, you can submit a suggestion on http://connect.microsoft.com/VisualStudio

    Best regards.
    Rong-Chun Zhang

    Wednesday, October 17, 2007 6:03 AM
  • Interesting. I read that, and thought it was just in case [TARGETDIR] did not end in a slash. I had no idea it was a workaround for a quoting problem.

     

     

    Wednesday, October 17, 2007 7:59 AM