开发者

MSI Installer - custom parameter for data directory fails if more than one level in directory structure

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜