tags:

views:

138

answers:

2

I think the default dir gets a trailing slash.

But what if the user selects a different directory?

Is there a way for the INSTALLDIR to NOT have a trailing slash?

It's not that I want it to not have a trailing slash. I want to know if I can count on it, so that, for example,

[INSTALLDIR]Filter.dll 

...will always resolve to a real, valid filesystem path.

Currently I use

[INSTALLDIR]\Filter.dll

and I get a double-slash in there. It's valid and resolves, but I'd like to eliminate the double slash.

thanks.

+1  A: 

It is my understanding that Windows Installer will add a backslash to any Directory table entry. Therefore, yes, you can eliminate your slash and not worry about things breaking.

In fact, this has even prompted InstallShield to create a KB article describing how to REMOVE the backslash...

http://kb.flexerasoftware.com/selfservice/viewContent.do?externalID=Q106587

William Leara
+2  A: 

Windows Instaler directory table entries ( which become properties after costing ) are always formatted by MSI to contain a trailing backslash. Including extra slashes will not harm the resolution.

Christopher Painter
Thanks. Does "after costing" imply "after the user may have selected a different install directory"?
Cheeso
Costing is performed from CostInitialize to CostFinalize. The directory table entries are available after the CostFinalize action. If the INSTALLDIR is then changed using a Type 35 Directory Custom Action or ControlEvent ( Browse Button ) it will be recosted and reformatted for the new value.
Christopher Painter

related questions