Old 20th August 2009, 17:12   #1
KKlucznik
Junior Member
 
Join Date: Aug 2009
Posts: 1
Get Absolute Path of file that calls exe

I have an altered Java Launcher exe file written in NSIS that launches a JAR file (http://nsis.sourceforge.net/A%5Fslig...ava%5FLauncher). I want to pass into the JAR a parameter, that parameter being the absolute path of the file which called the exe.

I know I can get the current working directory (System::Call "kernel32::GetCurrentDirectory(i ${NSIS_MAX_STRLEN}, t .r0)")...but that still isn't the path to the calling file.

In a BAT file I can use "start MyApp.jar %1" and that fills in the abs path, but that cannot be done in NSIS it seems (or I am not writing it correctly cause my parameter comes in literally as "%1").

I want my command to be: javaw -jar MyApp.jar AbsolutePath

Here is my line currently that I want that path added to:

StrCpy $0 '"$R0" -jar "${JAR}"'

Any suggestions would be appreciated. Thanks.
KKlucznik is offline   Reply With Quote
Old 20th August 2009, 19:44   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
${GetParameters} and GetFullPathName

IntOp $PostCount $PostCount + 1
Anders 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