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

Got a problem you cannot solve? Try here.
Lem2983
Posts: 13
Joined: Mon Feb 05, 2024 3:58 pm

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

Postby Lem2983 » Thu Mar 14, 2024 2:02 am

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.

JohnGaver
Posts: 80
Joined: Mon Feb 05, 2024 6:15 pm

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

Postby JohnGaver » Thu Mar 14, 2024 7:06 am

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).
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm

Lem2983
Posts: 13
Joined: Mon Feb 05, 2024 3:58 pm

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

Postby Lem2983 » Thu Mar 14, 2024 5:35 pm

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.

JohnGaver
Posts: 80
Joined: Mon Feb 05, 2024 6:15 pm

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

Postby JohnGaver » Fri Mar 15, 2024 12:03 pm

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.
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm

JohnGaver
Posts: 80
Joined: Mon Feb 05, 2024 6:15 pm

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

Postby JohnGaver » Tue Apr 02, 2024 11:29 am

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.
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm

JohnGaver
Posts: 80
Joined: Mon Feb 05, 2024 6:15 pm

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

Postby JohnGaver » Mon Apr 08, 2024 8:27 am

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!
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm


Return to “Technical Support”

Who is online

Users browsing this forum: Google [Bot] and 37 guests