How can I convert a path to DOS or UNIX style?

asked 13 Sep '11, 09:35

Jake's gravatar image

Jake ♦♦
826222226235
accept rate: 98%


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.

link

answered 13 Sep '11, 09:39

Jake's gravatar image

Jake ♦♦
826222226235
accept rate: 98%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×176
×28
×8
×6

Asked: 13 Sep '11, 09:35

Seen: 2,918 times

Last updated: 13 Sep '11, 09:39