[SOLVED] Set working dir for Java app? - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

csmart
Posts: 22
Joined: Tue Sep 22, 2009 7:49 am

[SOLVED] Set working dir for Java app?

Greetings,

I'm in the middle of testing Advanced Installer for our software project and so far it's going really well.
There's just one problem I can't seem to fix myself, hence the query on the forums.

We have a java program which relies on several external libraries. These are stored in the "external" directory under "C:\Program Files\Us\OurApp\" where the jar file and exe which Advanced installer creates, both live.

If I run the program from the shortcut created by the installer, everything works perfectly. The program loads the external jars and all is well. However, running the exe from elsewhere (like calling its full path from the command line) loads the program, but it cannot find the external jars (because they aren't in the location I'm running the exe from).

So, I'm wondering if it's possible to set a working directory for the exe itself, perhaps in the accompanying ini file? The reason this is important is that I have created a File Association which needs to launch the software, but it's broken because of the above issue.

I looked into custom actions, but couldn't see how to make that work. I'm not normally a Windows developer, so I'm not sure about these things.

Any help greatly appreciated!

Thanks!
Chris
Last edited by csmart on Wed Sep 30, 2009 3:05 am, edited 1 time in total.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Set working dir for Java app?

Hello Chris and welcome to Advanced Installer Forums,

You can set a working directory for your java product by doing the following:
- go to "Java Products" page
- selecting your product
- on the Settings tab, in the Application section, tick the "Set product folder as current".

I hope you find this of use. If you need further help, do not hesitate to ask.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
csmart
Posts: 22
Joined: Tue Sep 22, 2009 7:49 am

Re: Set working dir for Java app?

Hey Gabriel,

Thank you, good to be here!

Thanks also for your suggestion. Enabling this appears to solve the problem. The box seems a little cryptic to me, I did see it there but it didn't look important at the time :-)

Cheers,
-c

Return to “Common Problems”