Page 1 of 1

IA Multi Platform (Linux) how to expand path in the script

Posted: Thu Mar 14, 2024 2:02 am
by Lem2983
Hello,

I have a quick question about possible solution for the following problem:
during uninstall I need to remove an application specific directory (for example "1") with settings created outside of the installer (i.e. by the user application).

Let's say for simplicity I am speaking about "/home/user/.config/1"

Step1: retrieve the name of the config directory:

<Get Folder Location Other->Local Application Data into LOCALAPPDATA>

LOCALAPPDATA contains the string "~/user/.config" and this is the problem because "Remove Directory" call expects a fully qualified path i.e.:

<Remove Directory (including all its files and subfolders) "~/user/.config/1"> - does not work.

<Remove Directory (including all its files and subfolders) "/home/user/.config/1"> - work just fine.

What is the simplest way to expand the path returned in "LOCALAPPDATA" variable in the installer script on Linux?

Thanks.

Re: IA Multi Platform (Linux) how to expand path in the script

Posted: Thu Mar 14, 2024 7:06 am
by JohnGaver
Please use the Convert Path command, picking Convert to Long Path as your operation, and passing in the variable holding the short form of your path.

On Windows, this command converts between short and long path forms (c:\progra~1 to c:\program files type operations).

On macOS and Linux, this command expands ~/ notations into fully qualified paths (exactly what you are looking for).

Re: IA Multi Platform (Linux) how to expand path in the script

Posted: Thu Mar 14, 2024 5:35 pm
by Lem2983
JohnGaver wrote:Please use the Convert Path command, picking Convert to Long Path as your operation, and passing in the variable holding the short form of your path.


Oh thanks, I am not sure how I overlooked that. Yes indeed "Convert to Long Path" expands the tilda and turns the path into the fully qualified path. But I still face a weird situation which I cannot explain.

This is the simplified example:

<Set Variable LOCALAPPDATA11 to /home/tester/.config/>
<Remove Directory (including all its files and subfolders) $LOCALAPPDATA11$1>
<MessageBox: $TITLE$ Setup, STEP 1<$LOCALAPPDATA11$1>VS</home/tester/.config/1>

the directory "/home/tester/.config/1" was not deleted

<Remove Directory (including all its files and subfolders) /home/tester/.config/1>
<MessageBox: $TITLE$ Setup, STEP 2<$LOCALAPPDATA11$1>VS</home/tester/.config/1>

the directory "/home/tester/.config/1" was deleted successfully

In other words, I don't understand why when I pass to "Remove Directory" call the fully qualified path as a string it works, but when I assign the same path to a variable and pass it to "Remove Directory" call it it does not work.

Thanks.

Re: IA Multi Platform (Linux) how to expand path in the script

Posted: Fri Mar 15, 2024 12:03 pm
by JohnGaver
It should certainly work.

Could you attach an empty project which does just this and nothing else, and I'll have this escalated for you right away.

Re: IA Multi Platform (Linux) how to expand path in the script

Posted: Tue Apr 02, 2024 11:29 am
by JohnGaver
Just to let you know that R&D have informed me Remove Directory was indeed not supporting variables before, but this issue is already fixed in the next scheduled update with a plethora of other improvements and fixes.

Re: IA Multi Platform (Linux) how to expand path in the script

Posted: Mon Apr 08, 2024 8:27 am
by JohnGaver
The latest build incorporating this fix for InstallAware Multi Platform is now live.

Your web update client will tell you more about what's new in this build, but most exciting to me was the availability of silent installations on InstallAware Multi Platform for the first time.

Enjoy!