Old 27th March 2014, 08:49   #1
JohnJohnson
Junior Member
 
Join Date: Mar 2013
Posts: 2
Using Java after installing Java with NSIS

Hello,

I have a question regarding Java and NSIS. I make an silent install of Java JDK and JRE 1.7.51, which is called from NSIS. This works fine, but directly after installing Java I run a batchscript which contains the following:
"java -doSomething"

The problem is that the batch-output says that java is an invalid command, therefore I think Java isn't recognized by some reason. When I stop the installer and start the batch manually it works fine. The problem only occurs when I open the batch file within the same install routine.

This also happens with some environmental variables, which are set during the same install routine.

Does anyone have an idea why this might happen?

I am using NSIS 2.46.
JohnJohnson is offline   Reply With Quote
Old 27th March 2014, 15:36   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,287
The installer will not get its %path% updated, only Explorer.exe picks up those changes...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 2nd April 2014, 09:09   #3
JohnJohnson
Junior Member
 
Join Date: Mar 2013
Posts: 2
Thanks for the reply! Is there a way to "force" Explorer.exe to do so?
JohnJohnson is offline   Reply With Quote
Old 2nd April 2014, 19:40   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,287
Most of the samples on the wiki already do it:
Quote:
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000

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