You are here

How to handle an Application installed in 2 directories?

9 posts / 0 new
Last post
david_pi
Offline
Last seen: 1 year 3 months ago
Joined: 2011-03-19 09:44
How to handle an Application installed in 2 directories?

Hi everyone.

I'm tying to make a portableapp. It's main program is stored in two directories: "c:\Program Files\AppName" and "c:\Program Files\Common Files\AppName"(not java or other plugin). So how do I handle this?

I put "c:\Program Files\AppName" into "App\Appname". Put "c:\Program Files\Common Files\AppName" into "App\DefaultData\Common Files\AppName" and wrote this in launch.ini:

Common Files\AppName=%CommonProgramFiles%\AppName

So before the application launched, the "Common Files" part is copied to "%CommonProgramFiles%\AppName". After the application is closed, copied back into Data directory. I don't think this is a good idea. It took long time to copy back. It is unnecessary to copy it back. I just want to delete the copy after the application closed, rather than copy it back. So how to do? Please help me. Thanks.

And I have another question.The program I'm working on has two executable files. How to make two portableapps launchers like AppNamePortable1.exe and AppNamePortable2.exe. How to write the launch.ini? I read the Manual and didn't got the answer. Please help, thanks.

Regards,
David Pi

Aluísio A. S. G.
Offline
Last seen: 7 years 9 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
What app? Not supported

If you tell us what is the app, we will be able to analyze it and maybe we could help you better.
Regarding multiple launchers, it seems that it's not supported yet. (@Chris: build all, select in extra page, other alternatives?)

Previously known as kAlug.

david_pi
Offline
Last seen: 1 year 3 months ago
Joined: 2011-03-19 09:44
I think the app name is not

I think the app name is not very importank. It's an instant messaging app, installed some dll files in Common Files. Sad

I think the OpenOffice Portable is a multi launcher app, isn't it?

Aluísio A. S. G.
Offline
Last seen: 7 years 9 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
Yes; not sure if PAL

Knowing the app would allow us to perform an analysis ourselves.
What are the DLLs? Are them really necessary?

Yes, OOo/LO is multi-launcher, but I'm not sure if it's using PAL.

Previously known as kAlug.

david_pi
Offline
Last seen: 1 year 3 months ago
Joined: 2011-03-19 09:44
Yes. But I'm just a P.A fan,

Yes. But I'm just a P.A fan, learning how to build portableapps, most for fun. Telling the app's name may end the discussion. Biggrin

Yes, the program can't run without those DLLs. Most of them is like little games, photo uploading, etc, as additional features of the app.

Aluísio A. S. G.
Offline
Last seen: 7 years 9 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
DLL names; IRC

Writing things to system dirs is really a bad idea.
Can you join the IRC channel? The discussion there is more active.

Previously known as kAlug.

david_pi
Offline
Last seen: 1 year 3 months ago
Joined: 2011-03-19 09:44
Hi.I'm still working on

Hi.I'm still working on it.
If I want copy "App\Common Files\AppName" to $COMMONFILES\AppName at the beginning (if target already exist, rename it.)
And delete $COMMONFILES\AppName at the end(don't copy back), restore the renamed directory.
How do I write the code?
I know nothing about NSIS code.Could you help me? Thanks.

David

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 10 months ago
Joined: 2007-04-15 21:08
Unlikely to actually be required

It's unlikely that it actually requires the files to be in the Common Files directory. What happens if you put these DLL files in the app's own directory?

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

david_pi
Offline
Last seen: 1 year 3 months ago
Joined: 2011-03-19 09:44
I've write some codes

I've tried but it can't work. Must be put into commonfiles.
But now I've wrote some codes. It seems works great. Biggrin


${SegmentFile}

${SegmentPrePrimary}
Rename "$COMMONFILES\AppName" "$COMMONFILES\AppName-backupbyportableapps"
CopyFiles /SILENT "$EXEDIR\App\Common Files\AppName" "$COMMONFILES\AppName"
!macroend

${SegmentPostPrimary}
RMDir /r "$COMMONFILES\AppName"
Rename "$COMMONFILES\AppName-backupbyportableapps" "$COMMONFILES\AppName"
!macroend

Thanks anyway.

Log in or register to post comments