Page 1 of 1

Capturing \\\\ as entered on custom dialog

Posted: Wed Sep 27, 2006 10:00 am
by netProgrammer
I have a custom text entry field that requests a Network Share value from the user. The expected format is something like:

\\\\ServerName\\Share

I am capturing the value entered into a variable; however both of the \\\\ characters are not being retained. Only one \\ come through in the variable.

If I enter the value as:

\\\\\\ServerName\\Share (prepending \\\\\\ in the field)

then I get the expected value of:

\\\\ServerName\\Share


So my question is: how do I maintain both the \\\\ characters at the beginning of the text entry without making the user enter \\\\\\?

Any help is appreciated.

Thanks.

Posted: Wed Sep 27, 2006 1:13 pm
by MichaelNesmith
Can you show a MessageBox right after the dialog returns and see what you get? Some commands will eliminate \\\\ into \\ as a convenience when using paths, and I think this might be what you're running into - but the elimination is smart enough to respect UNC paths.

Posted: Wed Sep 27, 2006 1:27 pm
by netProgrammer
The UNC name is not being respected... the \\\\ are converted automatically and immediately to \\.

Is there a way to work around this?

Posted: Wed Sep 27, 2006 1:32 pm
by MichaelNesmith
The InstallAware Web Update script uses a text control and accepts input in this form: \\\\server\\username. That works fine, which is why I asked you to confirm right after showing your dialog with a MessageBox.

Posted: Wed Sep 27, 2006 1:50 pm
by netProgrammer
It has the correct value in a message box immediately after the dialog. When I try to use that value as a parameter on a "Run Program" command, the value does not contain both \\\\.

What do I need to do to have InstallAware maintain both \\\\ characters so that the full and correct network share will be contained in the variable value?

Posted: Wed Sep 27, 2006 2:40 pm
by MichaelNesmith
I see, so Run Program is losing it. I would add \\\\ in front of the variable to make sure it doesn't lose it. So if the variable in the dialog is called $VAR$, use it in Run Program as \\\\$VAR$.