I am creating an MSI installer where the user can choose a data directory seperate to the install path. I have a custom action string as below where Param1 is the data directory.
/targetdir="[TARGETDIR]\" /Param1开发者_开发百科="[EDITA1]\"
If the user enters C:\DataDirectory, then the parameter is accepted by the installer and the value is passed on to my custom Install override method where the directory is created.
If the user enters a directory with more levels in it's structure, regardless of whether the directory already exists or not, the install fails before anything in my Install override method is hit.
Why is this?
I don't want to restrict the user to having to place the directory at root level?
Got it, the custom action string was the problem:
Change
/targetdir="[TARGETDIR]\" /Param1="[EDITA1]\"
to
/targetdir="[TARGETDIR]\" /Param1="[EDITA1]"
The slash at the end seemed to indicate something to the installer, where really I just wanted the value passed stright through to my custom code
Hope this helps others
精彩评论