Old 16th May 2018, 13:52   #1
Gluck
Member
 
Join Date: Apr 2018
Posts: 61
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???
Gluck is offline   Reply With Quote
Old 16th May 2018, 15:08   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,733
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.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 17th May 2018, 10:16   #3
Gluck
Member
 
Join Date: Apr 2018
Posts: 61
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".
Gluck is offline   Reply With Quote
Old 17th May 2018, 17:30   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,733
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.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 17th May 2018, 18:14   #5
Gluck
Member
 
Join Date: Apr 2018
Posts: 61
"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?
Gluck is offline   Reply With Quote
Old 18th May 2018, 01:01   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,733
run cmd.exe and type
Quote:
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.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 18th May 2018, 11:28   #7
Gluck
Member
 
Join Date: Apr 2018
Posts: 61
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?
Gluck is offline   Reply With Quote
Old 18th May 2018, 11:32   #8
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,733
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.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 18th May 2018, 14:07   #9
Gluck
Member
 
Join Date: Apr 2018
Posts: 61
Thanks.
Gluck is offline   Reply With Quote
Old 22nd May 2018, 23:20   #10
Nutzzz
Junior Member
 
Join Date: May 2007
Location: Orange County, CA, U.S.A.
Posts: 40
I'd guess they're using a symlink. See the Windows built-in mklink command.
Nutzzz is offline   Reply With Quote
Old 23rd May 2018, 16:31   #11
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,733
A symlink affects every process on the system and you are not really portable at that point.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 23rd May 2018, 20:43   #12
Nutzzz
Junior Member
 
Join Date: May 2007
Location: Orange County, CA, U.S.A.
Posts: 40
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.
Nutzzz is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump