Old 11th June 2013, 08:50   #1
ilaiyaraja
Member
 
Join Date: Sep 2012
Posts: 81
How to generate two exe in single installer?

I have created exe based on which os environment running.ie.If i run X64 bit os it will install jre 64 bit else install jre32bit.Now i want to create two exe files based on user inputs instead of finding os environment.
I have created exe in ant tool using following code:

<exec executable="C:\Program_Files\NSIS\makensis.exe" failonerror="true" >
<arg value="/DPROJECT_NAME=${ant.project.name}"/>
<arg value=/Dversion=64"/>
<arg value="${basedir}\raport.nsi"/>
</exec>


1.How to pass this version value to NSIS script, based on this value to create exe?
2.How to change EXE name to version value? that is if the user pass 64 the EXE named as setup{version}.exe.

Last edited by ilaiyaraja; 11th June 2013 at 10:00.
ilaiyaraja is offline   Reply With Quote
Old 11th June 2013, 10:50   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
It seems to me that you already have your own solution: By supplying the /dversion=64 parameter to makensis, you can just use "name yourname${version}". What exactly are you trying to accomplish?
MSG is offline   Reply With Quote
Old 11th June 2013, 15:11   #3
ilaiyaraja
Member
 
Join Date: Sep 2012
Posts: 81
Thanks MSG.
!ifdef PLATFORM64
OutFile setup64.exe
!else
OutFile setup32.exe
!endif
Its getting working fine.Two exe file created based on user inputs passed from ant.

Now i have question about JRE
I have created name as 64 and 32 based on user inputs parameters.

Based on this name i want to include any one jre either 32 or 64 .No need to include tow jre files.

${StrContains} $0 "64" OutFile
StrCmp $0 "" Notfound
SetOutPath '$TEMP'
SetOverwrite on
File lib\jre-6u33-windows-i586.exe
File /oname=$JRE_INSTALLER_FILE_NAME "$TEMP\jre-6u33-windows-x64.exe"
Notfound:
SetOutPath '$TEMP'
SetOverwrite on
File lib\jre-6u33-windows-i586.exe
File /oname=$JRE_INSTALLER_FILE_NAME "$TEMP\jre-6u33-windows-i586.exe"


But it seems to be not working fine.I dont know what am i did wrong?
How to include any one jre based on the outfile named?
ilaiyaraja is offline   Reply With Quote
Old 11th June 2013, 20:59   #4
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
You can't use OutFile as a variable.
Do something like
code:
!ifdef PLATFORM64
!define OutFileName setup64.exe
!else
!define OutFileName setup32.exe
!endif
OutFile ${OutFileName}
...
${StrContains} $0 "64" ${OutFileName}
StrCmp $0 "" Notfound
...

jpderuiter is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
java, nsis

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