cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ecurren
Level 3

Path seperators missing from absoluteInstallLocation

Hello all,
I am experiencing a problem when I assign $PATH($P(absoluteInstallLocation)) to a string variable in the Swing Events code in a custom dialog box. When I use $PATH($P(absoluteInstallLocation)) as an argument for a path location it works fine, however when I use it in this fashion:

arg0.resolveString(“$PATH($P(absoluteInstallLocation))”) it returns “C:Program FilesMyCompanyMyProject” rather than “C:\Program Files\MyCompany\MyProject”

Can someone help me to resolve this?

Thanks much all.
Labels (1)
0 Kudos
(6) Replies
RobertDickau
Flexera Alumni

That's strange; how are you using that string? Using this in the Swing code for the Welcome dialog seems to work:
String msg = arg0.resolveString("$PATH($P(absoluteInstallLocation))");

javax.swing.JOptionPane.showMessageDialog(null, msg);
As a test, does it work if you remove the $PATH part of it?
0 Kudos
ecurren
Level 3

Hi Robert,
Thanks for your help with this. The code you posted does indeed show the path separators.

What I'm attempting to do is to update an ASCII text file with the path of the installation location. I have a custom dialog that has the following code:

String httpConfData = httpConfDataString.toString();
httpConfData = httpConfData.replaceAll("@@ServerRoot@@", "\"" + arg0.resolveString("$PATH($P(absoluteInstallLocation))") + "\"");
FileWriter writer = new FileWriter(httpConf);
writer.write(httpConfData);
writer.close();

I tried this approach after attempting to use an ASCII File Update action placed under the Behavior and Logic -> Sequences -> Product Sequences -> Installation Sequence -> Post Install after the Post-Install Summary Dialog. The problem I have there is that the Replace action I have does not appear to execute. I added an Add Line/Text/Comment update action which truncated the file and then added the text I specified, so I know that I have the file correct, and that the ASCII File Update action is executing.

In the end, I just need to update an ASCII text file with the installation path.

Thanks much for your help.
0 Kudos
RobertDickau
Flexera Alumni

For your method, does it work if, instead of using $PATH, you use $N with a double backslash as the separator?

Something like this, perhaps:

$N($P(absoluteInstallLocation), \\)
0 Kudos
ecurren
Level 3

Hi Robert,
No such luck. Any ideas on what else I can try?

Thanks much.
0 Kudos
RobertDickau
Flexera Alumni

Perhaps we can investigate why the ASCII File Update action isn't working. For example, I'm installing a file called replace.properties, which contains the line:

Where=%HERE%

In the same component as the Files action that installs the file, I add an ASCII File Update action underneath that points to that file name, with these two actions/settings---

1. Search Line/Text; Tokens: %HERE%; Return Position: First Token

2. Replace Line/Text; Old Line: %HERE%; New Lines: $PATH($P(absoluteInstallLocation))

---and it seems to work...
0 Kudos
ecurren
Level 3

AH-HA. That's it. I didn't put in a search action before the replace action, (I assumed that the replace action would implicitly do this). Thanks for your help Robert!
0 Kudos