Archive: Create the installation exe before compiler finish


Create the installation exe before compiler finish
Hi There!

I created a compiler entry to create an installation ISO file. But the exe file will be created on the end of the script. Is there a way to create the install exe before?

Cheers
Gabriel

# Create a installation CD Image
!ifdef CreateISO
!system '${InstallScriptInput}\mkisofs -R -V "eCognition-${PRODUCT_VERSION}" \
-P Definiens -J -joliet-long "${Output}" > "${Output}\..\${FileName}.iso"'
!endif


For what you need that?


Well... to create a iso file within the script


But the exe file will be created on the end of the script. Is there a way to create the install exe before?
For what you need that?

What algorithm you trying to realize?

I create a whole installation package using NIS. I use one script for 10 different products. This works perfect. At the end of the compilation I would create an ISO file within all files to be able to burn cd’s. But if the installation executable doesn’t exist I couldn’t create such an ISO. I’m would be happy if I don’t need external scripts to do that.
[code]

#######################################################
### FINAL COMPILER COMMANDS
#######################################################

# copy files which are neede on the installation CD
!system '${InstallScriptInput}\robocopy /NFL /E "${ProductInput}\cd-Root" "${Output}" '
!system '${InstallScriptInput}\robocopy /NFL /E "${InstallInput}\AllVersions-CD-Root" "${Output}"'
!system '${InstallScriptInput}\robocopy /NFL /E "${ProductInput}\UserGuides" "${Output}" '

# Create a installation CD Image
!ifdef CreateISO
!system '${InstallScriptInput}\waitForFile.bat "${Output}\Setup.exe"'
!system '${InstallScriptInput}\mkisofs -R -V "eCognition-${PRODUCT_VERSION}" \
-P Definiens -J -joliet-long "${Output}" > "${Output}\..\${FileName}.iso"'
!endif


I’m would be happy if I don’t need external scripts to do that.
:) I suppose no other ways. You need just one external exe that will be run with !execute and do all FINAL COMPILER COMMANDS.

Hm.. There is another way.

Compile.bat (in the same directory of the script)

@echo off
SET NSISDIR=C:\Program Files\NSIS
SET SCRIPT=MyProgram.nsi

IF EXIST "%temp%\CreateISO.bat" DEL "%temp%\CreateISO.bat"
"%NSISDIR%\makensis.exe" %SCRIPT%
"%temp%\CreateISO.bat"
DEL "%temp%\CreateISO.bat"
SET NSISDIR=
SET SCRIPT=


MyProgram.nsi
Name "MyProgram.exe"
OutFile "MyProgram.exe"

Section
!define EXEC MyProgram.exe
!system `ECHO START ${EXEC}>"$%temp%\CreateISO.bat"`
SectionEnd

Ok. This is a possible solution. Thanks.

But the better would be a compiler command like… :-)

!CreateInstallallationExeNOW

Cheers
Gabriel


Well how is that possible when the compiler has to parse the whole script from start to finish before creating the exe? That is defeating logic in one way or another!

Edit: A better solution would be for NSIS to reserve a special macro name which would be used when the exe has been created - e.g. !macro .onCompileComplete
Obviously the macro can only be allowed to contain compile time (!) instructions.

Similarely, an .onCompileEnd would be useful too, i.e. just before the exe is created.

-Stu