Archive: How to generate two exe in single installer?


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.


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?


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?


You can't use OutFile as a variable.
Do something like

!ifdef PLATFORM64
!define OutFileName setup64.exe
!else
!define OutFileName setup32.exe
!endif
OutFile ${OutFileName}
...
${StrContains} $0 "64" ${OutFileName}
StrCmp $0 "" Notfound
...