Archive: [Problem] Embedding other Installer


[Problem] Embedding other Installer
Hi all,

Since some days im trying to build a installer script which installs the main flash application and also the Acrobat Reader 7...if wanted.

On the NSIS Wiki are some code examples i try to implement in my actual script. But it dont get is solved to get the component "Adobe Acrobat Reader 7" into the Components Page, so the user could check/uncheck the Acrobat Reader Setup.
There's always just my Component "Flash Application".

Script attached in next post.

On the NSIS Wiki page "Embedding other Installer" the author says "You will need to download several binaries to get this script to compile"...but what binaries i need ?

Please help!

Greetings
Thalos


You're specifying a relative path to execute in your Adobe Reader section.

Please attach your script as a separate text file.

Stu


Ok, here comes the file

Thanks for Help!


Put this at the top of your Adobe Reader section
SetOutPath "$INSTDIR"

And change ExecWait to ExecWait "$INSTDIR\ ...

Stu


Hmm, still not working as intended...

i replaced the following as you said :

Section "Adobe Acrobat Reader 7" SEC02
SetOutPath "$INSTDIR"
File "prerequisites\AdbeRdr709_DLM_de_DE.exe"
ExecWait "$INSTDIR\"
SectionEnd

..but im not sure if i did it correctly...at the ExecWait "$INSTDIR\ ..." command im not sure what should be placed after the slash. But i tried some things (like "$INSTDIR\prerequisites\AdbeRdr709_DLM_de_DE.exe", "$INSTDIR\", "$INSTDIR\prerequisites"), but i never got the "Adobe Acrobat Reader 7" entry in the components page, still only the "Digitale Fotografie Anwendung".

I attached the actual .nsi file again


ExecWait '"$INSTDIR\AdbeRdr709_DLM_de_DE.exe" "/sPB /rs /l /msi /qb-! /norestart ALLUSERS=2 EULA_ACCEPT=YES SUPPRESS_APP_LAUNCH=YES"'

Stu


No, that doesnt bring the entry in the components page. Still only the "Digitale Fotografie Anwendung"-entry..


You'll need to do some testing. Check that $INSTDIR\AdbeRdr709_DLM_de_DE.exe exists, execute that command in command prompt etc

Stu


Ok, i did some testing on the weekend and nearly got solved the problem. Im now getting the "Adobe Acrobat Reader"-entry in the Components page during installation. BUT after installing the main application, it doesnt executes the Acrobat Reader setup exe. Im thinking the failure is in the "ExecWait" command line which have to be adjusted a bit to execute the acrobat reader setup file correctly.

My file hierarchy:

Digitalfotografie
|__dat
|
|__pdf
|
|__prerequisites
| |_AdbeRdr709_DLM_de_DE.exe
|
main application exe

And heres the section script segment for the Adobe Reader Setup:

Section "Adobe Acrobat Reader" SEC02
SetOutPath "$INSTDIR"
File "prerequisites\AdbeRdr709_DLM_de_DE.exe"
ExecWait '"$INSTDIR\AdbeRdr709_DLM_de_DE.exe" "/sPB /rs /l /msi /qb-! /norestart ALLUSERS=2 EULA_ACCEPT=YES SUPPRESS_APP_LAUNCH=YES"'
SectionEnd

Here, i dont understand what the "/sPB /rs /l /msi /qb-" commands really does, so please explain it to me :)

I also tried to execute the "AdbeRdr709_DLM_de_DE.exe"
from the CD Path (File "$EXEDIR\prerequisites\AdbeRdr709_DLM_de_DE.exe), but that doesnt solve it also im not sure if this is a correct way...

So please guys help the unskilled NSIS scripting Thalos to solve this. :)

Thanks for help!


Those are command line parameters for the installer. You could try Google.

Stu


Ok found something...
/sPB - silent mode with progress Bar
/rs - Reboot Suppress
/l - Enable Error Logging
/msi -[Command line] Parameters for MSIEXEC
/qb-! - to hide the Cancel button.

But why he doesnt execute the Adobe Reader Setup ?


You have in your command line:
SUPPRESS_APP_LAUNCH=YES

Stu :D


hmm, no that doesnt help ^^

if i delete this command it doesent execute the setup :)
And if im right this command is just for the supress of launching the application AFTER installation.


Right I am confused now. I thought you said the setup runs because you get an entry in Add/Remove, so what is the problem?

Stu


ok, next try :)

my english isnt good, but im trying to explain the problem now as detailed as i can :)

Im trying to build a installer with MDM Zinc. Zinc uses the NSIS script. And this NSIS script i want to change. I have a Flash Application which gets installed correctly (install/uninstall script is ok), but to use this flash application with its full functions the user needs Acrobat Reader 7+ . I have downloaded a setup file for Acrobat reader named "AdbeRdr709_de_DE.exe" which i want to be installed after the Flash Application Setup.

To do this i changed the "standard"-script and inserted the "MUI_PAGE_COMPONENTS".
Now i have 2 Section (1 for the Flash Application and 1 for the Adobe Reader Setup) which now can be check/unchecked during installation at the Components Page.so far so good...

http://support-thinkhouse.de/nsis/components.gif

The Problem is that it doesnt include the Adobe Reader setup file. Cause if i uncheck the Main Application the file size shrinks to 0.0Kb...
I really tried several Path Variants, thinking that this would be the problem, but never get it solved whatever path i give to the Adobe Reader Setup file...

http://support-thinkhouse.de/nsis/components2.gif

Here again my file hierarchy:

Digitalfotografie
|__dat
|
|__pdf
|
|__prerequisites
| |_AdbeRdr709_DLM_de_DE.exe(this i want to execute after installation)
|
main application exe


And here is the actual fsp.nsi in txt format again:


That script cannot possibly compile. $EXEDIR is a run time variable and yet you are using it in a compile time instruction (File "$EXEDIR\AdbeRdr709_de_DE.exe").
Or did you just change that now?

Stu


Yeah that was my last try. :)
Thought that this would execute the file from CD...

but in the "File" and "ExecWait" command line i tried several things such as :

-File "$INSTDIR\AdbeRdr709_de_DE.exe"
-File "AdbeRdr709_de_DE.exe"
-File "\prerequisites\AdbeRdr709_de_DE.exe"

and some other things...same in "ExecWait" command line


Are you sure that the script is even compiling?
If makensis cannot find the file you will get an error on compile and the new installer will not be created.

Stu


Ahaa found something new..."Compile NSIS Scrip" :)

Never did that...always saved the file and the changes were accepted ^^

Ok i compiled it and the makensis said the following:

Processing script file: "E:\Programme\MDM Zinc v2.5\NSIS\fsp.nsi"
!define: "PRODUCT_NAME"="MyFSPApplication1234567890"
!define: "PRODUCT_KEYNAME"="Ratgeber digital"
!define: "PRODUCT_VERSION"="1234567890.1234567890"
!define: "PRODUCT_PUBLISHER"="Mycompany,Inc.1234567890"
!define: "PRODUCT_WEB_SITE"="http://www.fsp1234567890fsp.com"
!define: "PRODUCT_DIR_REGKEY"="Software\Microsoft\Windows\CurrentVersion\App Paths\fspprojectorreglocation1234567890.exe"
!define: "PRODUCT_UNINST_KEY"="Software\Microsoft\Windows\CurrentVersion\Uninstall\MyFSPApplication1234567890"
!define: "PRODUCT_UNINST_ROOT_KEY"="HKLM"
!include: could not find: "C:\Programme\NSIS\System.nsh"
Error in script "E:\Programme\MDM Zinc v2.5\NSIS\fsp.nsi" on line 16 -- aborting creation process

so he doesnt find the "System.nsh" in that directory. Well, the file system.nsh doesnt exist there, its in C:\Programme\NSIS\Examples\System\System.nsh

Should i give the rigth pass to it in the script or copy the file to the NSIS directory ?


Saving the .nsi file will not automatically build the .exe file!!! This has never been the case, so perhaps all this time you've been using your first built installer which has always been broken :(

!include "${NSISDIR}\System.nsh"
->
!include "MUI.nsh"

Stu


Saving the .nsi file will not automatically build the .exe file!!!
no no ^^
the compilation is also done by Zinc. I always hit "build" after changing something in the script. But it doesnt says me if is something wrong in the script linke makensis does.

!include "${NSISDIR}\System.nsh"
doesnt help...the System.nsh is in another directory, so i changed this in ""${NSISDIR}\Examples\System\System.nsh" and its ok.


But now he gives an error i dont understand :confused:

Processing script file: "E:\Programme\MDM Zinc v2.5\NSIS\fsp.nsi"
!define: "PRODUCT_NAME"="MyFSPApplication1234567890"
!define: "PRODUCT_KEYNAME"="Ratgeber digital"
!define: "PRODUCT_VERSION"="1234567890.1234567890"
!define: "PRODUCT_PUBLISHER"="Mycompany,Inc.1234567890"
!define: "PRODUCT_WEB_SITE"="http://www.fsp1234567890fsp.com"
!define: "PRODUCT_DIR_REGKEY"="Software\Microsoft\Windows\CurrentVersion\App Paths\fspprojectorreglocation1234567890.exe"
!define: "PRODUCT_UNINST_KEY"="Software\Microsoft\Windows\CurrentVersion\Uninstall\MyFSPApplication1234567890"
!define: "PRODUCT_UNINST_ROOT_KEY"="HKLM"
!include: "C:\Programme\NSIS\Examples\System\System.nsh"
!define: "System.NSH.Included"=""
!include: closed: "C:\Programme\NSIS\Examples\System\System.nsh"
!include: "C:\Programme\NSIS\Include\MUI.nsh"
!include: "C:\Programme\NSIS\Contrib\Modern UI\System.nsh"
NSIS Modern User Interface version 1.78 - © 2002-2007 Joost Verburg (C:\Programme\NSIS\Contrib\Modern UI\System.nsh:11)
!define: "MUI_VERBOSE"="3"
!include: closed: "C:\Programme\NSIS\Contrib\Modern UI\System.nsh"
!include: closed: "C:\Programme\NSIS\Include\MUI.nsh"
!define: "MUI_ABORTWARNING"=""
!define: "MUI_ICON"="C:\Programme\NSIS\Contrib\Graphics\Icons\modern-install.ico"
!define: "MUI_UNICON"="C:\Programme\NSIS\Contrib\Graphics\Icons\modern-uninstall.ico"
!insertmacro: MUI_PAGE_WELCOME
!insertmacro: end of MUI_PAGE_WELCOME
!insertmacro: MUI_PAGE_LICENSE
LicenseData: open failed "Notes1234567890.rtf"
Usage: LicenseData local_file_that_has_license_text | license_lang_string
Error in macro MUI_PAGE_LICENSE on macroline 21
Error in script "E:\Programme\MDM Zinc v2.5\NSIS\fsp.nsi" on line 26 -- aborting creation process

Check 2 lines before the bit you boldened. It cannot find the file "Notes1234567890.rtf".

Ah right, "${NSISDIR}\Examples\System\System.nsh" is the script header for the System plugin.

Stu


puh ok, got the script compiled, but now im really confused..

..first of all im not cheking the link between the NSIS installer script an MDM Zinc...
i now changed the script, compiled it, built a new exe with Zinc and it now uses a old version of the script...:confused:

When i compiled the actaul script and test the installer via makensis i now have the 2 Components in the components page.
And after installing the Flash Application the Adobe Acrobat Reader Setup is started. Just how i wanted it to be :)

BUT...wait first of all my file hierarchy again :)

Anwendung
|__dat
|
|__pdf
|
|__prerequisites
| |_AdbeRdr709_DLM_de_DE.exe(
|
main application exe


and the script for the Flash Application:

Section "Digitale Fotografie Anwendung" SEC01
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
File "E:\Arbeit\Digitale Fotografie\Anwendung\Anwendung\"
CreateDirectory "$SMPROGRAMS\${PRODUCT_KEYNAME}\${PRODUCT_NAME}"
CreateShortCut "$SMPROGRAMS\${PRODUCT_KEYNAME}\${PRODUCT_NAME}\Digitale Fotografie.lnk" "$INSTDIR\Ratgeber digital - Digitalfotografie.exe"
CreateShortCut "$DESKTOP\Ratgeber digital - Digitale Fotografie.lnk" "$INSTDIR\Ratgeber digital - Digitalfotografie.exe"
SectionEnd

As u can see, i have changed this part, beacause the Flash Application needs 2 folder ("dat" and "pdf") and its whole contents to run. But with this command only the files in the "Anwendung"-folder are copied, the "dat" and "pdf" folder arent "installed"...

So 2. Question would be:
how do implement a whole folder-structure ?

i attach the actual fsp.nsi file if needed :)


You should check the documentation on File :)
Hint: /r.

Stu