Old 13th June 2012, 10:23   #1
cupid062985
Junior Member
 
Join Date: Jun 2012
Posts: 12
ExecWait fails when used with Defines

Hi Guys,

I am still new with NSIS. I would like to run a JAR File. I placed it in an Installer Section to run this.

DEFINES:
code:

!define PRODUCTPROFILE "setup\lib\myfile.xml"
!define LKMCSETUPTOOL "setup\lib\myjar.jar"
!define LKMCINTEG "my.class.sample.Main"
!define JAVAWEXE "jre\bin\javaw.exe"



SECTION:
code:

Section "-Setup" SEC06
SetOutPath "$APPDATA\setup"
File /r "..\data\tools\setuptool"
File "..\data\myfile.xml"

; Integrate License
ExecWait '"$INSTDIR\${JAVAWEXE}" -Dwinsysdir="C:\Windows\System32" -cp "$APPDATA\${LKMCSETUPTOOL}" "${LKMCINTEG}" "$APPDATA\${PRODUCTPROFILE}"'
Delete /REBOOTOK "$APPDATA\${PRODUCTPROFILE}"

SetFileAttributes "$APPDATA\setup" HIDDEN
SectionEnd



I noticed the following:
1. If I execute the code EXECWAIT in the onInit with different Define Values, it works.
2. If I hard code the Path, it also works.

Hope someone can help me. Thanks!
cupid062985 is offline   Reply With Quote
Old 13th June 2012, 11:21   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
The values of defines are substituted at compile time so using them will not effect how an instruction behaves unless your defined values are incorrect for their desired purpose.

My first guess would be that it is failing because you are using a relative path for LKMCINTEG and yet your working directory is $APPDATA\setup (SetOutPath sets the current working directory).

Stu
Afrow UK is offline   Reply With Quote
Old 14th June 2012, 04:01   #3
cupid062985
Junior Member
 
Join Date: Jun 2012
Posts: 12
Smile Thanks!

Thanks Stu! I will try to look at it...
cupid062985 is offline   Reply With Quote
Old 14th June 2012, 15:22   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,356
You should try running Process Monitor, I'm guessing the process is started and fails early for some reason...

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