Capturing \\\\ as entered on custom dialog

Got a problem you cannot solve? Try here.
Post Reply
netProgrammer
Posts: 5
Joined: Tue Sep 12, 2006 5:21 pm

Capturing \\\\ as entered on custom dialog

Post 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.
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post 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.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
netProgrammer
Posts: 5
Joined: Tue Sep 12, 2006 5:21 pm

Post by netProgrammer »

The UNC name is not being respected... the \\\\ are converted automatically and immediately to \\.

Is there a way to work around this?
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post 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.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
netProgrammer
Posts: 5
Joined: Tue Sep 12, 2006 5:21 pm

Post 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?
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post 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$.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Post Reply