How can I convert a path to DOS or UNIX style?
| Author: BitRock Support Date: August 07, 2008 06:46 Tags: |
Installbuilder
Installer environment variables Tips Windows Installer Variables |
The features explained in this article are only available when running an installer on Windows, having no effect on other platforms.
InstallBuilder has the following modifiers available to convert a path contained inside an installer variable or parameter to a different format:
- DOS format (8:3 short-style paths): append to the variable a ".dos" modifier. For instance, if the "${installdir}" parameter contains "C:\Program Files\My application", if you reference it using "${installdir.dos}", the path will be shown as "C:\PROGRA~1\MYAPPL~1". NOTE: this conversion relies on a feature of the Windows Operating System, which imposes as a condition that the file / folder referenced by the path must exist for the conversion to work.
- UNIX format (forward slashes): append to the variable a ".unix" modifier. For instance, if "${installdir}" contains "C:\Program Files\My application", if you reference it using "${installdir.unix}", the path will be shown as "C:/Program Files/My application".
Please note that using the above modifiers will not change the value contained inside the variable / parameter, the modifier only changes the resulting expansion of the variable.