Skip to content
⌘ NSIS Forum Archive

Redirect portable application folder

12 posts

Gluck#

Redirect portable application folder

I'm not sure about what I'm talking about, so, be careful...

In PortableApps there is a command, maybe "replace" to force the launcher to use a folder AS ANOTHER (ex: MyFolder substitute AppData).

In this way if the launcher has to copy many GB everytime, is faster intercept the command read/write from AppData to MyFolder.

It is a way to deceive the program to copy to a target or another.

Is there a similar command in NSIS???
Anders#
This question is too generic. If you are trying to make a 3rd-party application portable then you need to find out what this application does. Does it get the path from a environment variable, the shell API or the registry? You might need to inject a .dll and hook but then you need to ask somewhere else because it has nothing to do with NSIS.
Gluck#
I'm refeering (example) to TotalUninstall.

TU store the saved datain a folder in ProgramData.
There are system restoration points, copy of monitored programs, and so on.

This folder the firt time is empty, (so it is fast to backup), but in time, it grow in size (could be GBs).

The dimension of this folder slow down the launcher (restore and backup).

I have seen in PortableApps a way to "force the launcher to use a folder instead of another".
In this way they don't copy the whole folder, but say to the program: "the folder isn't in this position, but in this other one, use it from there".
Anders#
If TotalUninstall uses %ProgramData% then you can set that in the NSIS process before starting TotalUninstall. If it does something else then you cannot do it in NSIS.
Gluck#
"Then you can set that in the NSIS process before starting TotalUninstall"...

The question is obvious...

How can I set that in the NSIS process before starting TotalUninstall?
Anders#
run cmd.exe and type
set ProgramData=c:\something
c:\path\TotalUninstall.exe
and if that works you can set it in NSIS. If not, you have to ask somewhere else.
Gluck#
No, it doesen't works...
The program continue to use the original folder.
(maybe ProgramData is reserved path?).

What is the equivalent command in NSIS? (I could try it in Launcher).

Other ideas?
Anders#
http://nsis.sourceforge.net/Setting_...es_Temporarily but it is not going to work if using cmd.exe failed.

You will now have to ask on the portableapps forum, there is nothing we can do for you here.
Nutzzz#
I did a little search, and it looks like they just move files back and forth: before starting the program, the files are moved from the portable location to the program's hardcoded location, then after the program is closed the files are moved back to the portable location.

EDIT: Which, I guess, is what the OP was saying was ONE of the methods used.