Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Installing libraries before installation begins


8 replies to this topic

MerolaC

MerolaC
  • Full Members
  • 5 posts

Posted 20 April 2010 - 15:13

Hello everyone.
I'm new around here.
And I'm searching for some help.
I don't know the Install Script language at all, since i do simple installs like: Install files, add a registry entry and add a shortcut to the desktop. Thats about it.

But, what i need to know now, is, how to AFTER installation, make InstallShield install some Microsoft libraries (like DirectX, Visual C++ Redistributable, etc Silently if possible, with a little screen saying "Installing DirectX", etc)

How do i accomplish that?

As i said, I'm a complete noob when it comes to scripting.
So, i need this clean and simple.

I really appreciate any help.

Thank you.

Edited by MerolaC, 20 April 2010 - 15:21.


Maharani

Maharani
  • Full Members
  • 50 posts

Posted 21 April 2010 - 08:01

Hi,

you can look in ApplicationData/Prerequistes and ApplicationData/Objects for a prerequisite which meets your needs. That's the easiest way because you don't have to care about it.

If not you can provide the installer on your setup CD and call the exe with LaunchAppAndWait.
(Mail me if you need example code)

You shouldn't install AFTER installing your files, at least not the MFCRT. If you have a self-registering exe registering it will fail with very strange error messages if the appropriate MFCRT is not installed.
So you should call the exe in OnFirstUIBefore and OnMaintUIBefore, and in OnUpdateUIBefore if your setup provides all these dialogs.

Regards
Rita





MerolaC

MerolaC
  • Full Members
  • 5 posts

Posted 21 April 2010 - 16:15

Hi Rita, and Thank you.

The ApplicationData/Prerequistes and ApplicationData/Objects are going to help. Thanks.

Unfortunately, not everything i need is there.
I think i gonna need the "LaunchAppAndWait" Script sample.
So, if you can provide it to me, i will be really grateful.

Thank you again.

Best regards.
MerolaC

Maharani

Maharani
  • Full Members
  • 50 posts

Posted 22 April 2010 - 08:57

See the attachment.
In order to add the default OnXXXUIBefore-functions select the Behavior and Logic\InstallScript-Item in the InstallationDesigner. Select Setup.rul from the file list. On top of the right-hand pane you see two combo boxes. Select "Before Move Data" in the left one. The right one will then contain the OnXXXUIBefore-Items you will have to override. By clicking them the appropriate code will be inserted into the Setup.rul-file (if the name of the function is bold in the combo box the code is already there).
Insert the call for installing MFCRT at the approriate places in these functions (i.e. after the welcome dialog).

The attached file is only a snippet from my code with a few modifications, so it will not work as it is but should give you a general idea.
The script language itself is not too difficult and help is good if you happen to know what to look for.

Regards
Rita

Attached Files



MerolaC

MerolaC
  • Full Members
  • 5 posts

Posted 22 April 2010 - 15:58

Hi Rita.
Thank you once again.

But, that is not what i need (or at least I think so)

I need to call and exe from the CD/DVD in a folder Called "Libraries" (let say "CDROM:\Libraries\Rapture3D.exe") (Where CDROM, i mean for example D:/ E:/ etc) and make it install before the installation start (it should have a command line like "/SILENT" so it does not pop up any screen)

I hope i explain myself, my English is not so good and sometimes explaining things gets hard to me.
And, besides i don't know anything at all of the InstallScript language.

Or maybe if i give you the complete list of things that has to be installed, you can make the script for me. If you have time and want, of course.

Thank you.


Best Regards.
MerolaC

Edited by MerolaC, 22 April 2010 - 15:58.


Maharani

Maharani
  • Full Members
  • 50 posts

Posted 22 April 2010 - 16:41

QUOTE (MerolaC @ 2010-04-22 16:58)
Hi Rita.
Thank you once again.

But, that is not what i need (or at least I think so)

I need to call and exe from the CD/DVD in a folder Called "Libraries" (let say "CDROM:\Libraries\Rapture3D.exe") (Where CDROM, i mean for example D:/ E:/ etc) and make it install before the installation start (it should have a command line like "/SILENT" so it does not pop up any screen)

I hope i explain myself, my English is not so good and sometimes explaining things gets hard to me.
And, besides i don't know anything at all of the InstallScript language.



If this setup is on the same CD as the setup you provide, you should call
CODE
LaunchAppAndWait( SRCDIR ^ "Libraries\\Rapture3D.exe", "", WAIT)

Whether this can be installed silently depends on the setup routine of the third party component, so you should ask the Rapture3D-support for any setup options. If there are any use the second parameter of LaunchAppAndWait:
CODE
LaunchAppAndWait( SRCDIR ^ "Libraries\\Rapture3D.exe", "/silent", WAIT)

or whatever they provide for silent install (if at all).
I don't think that silent install is so important - as a user I would prefer to know what the setup is doing, so you could as well provide a message with a list of all required components you are about to install. So the user knows and isn't wondering what is going on.
Check the online help for LaunchAppAndWait, there are more options for the third parameter, like starting the window minimized.
And your English is at least as good as mine - I can offer German, though wink.gif.
As for InstallScript language - it's as simple or difficult as most of the other script languages I have seen, so there is no need to be worried.
What you have to know is that InstallShield in its Setup.exe follows some sort of generalized plan of how to install a software. By means of the functions I mentioned you will have the chance to change the default way and add your own functionality.
Like, for instance, the OnFirstUIBefore function. This is called when Setup is ready to start a first time installation of the software. If you don't provide such a function InstallShield will execute some default plan, like showing Welcome dialog, let the user select the setup type and features and so on. If you want to change this behaviour just select this function in the Setup.rul section as described in my earlier posting and InstallShield will present you the whole code it will execute in this function. This code is actually readable and even commented so you can really see what's done at this point of the setup. Then you just have to change the bits you want to. It's nothing special, just code after all.

Best regards
Rita


MerolaC

MerolaC
  • Full Members
  • 5 posts

Posted 22 April 2010 - 19:14

Thank you a lot Rita.
I managed to make it work.
Thank you!!!

Here is what i Did:


QUOTE

//===========================================================================
//
//  File Name:    Setup.rul
//
//  Description:  Blank setup main script file
//
//  Comments:     Blank setup is an empty setup project. If you want to
//      create a new project via. step-by step instructions use the
//      Project Assistant.
//
//===========================================================================

// Installation of ThirdParty-Components
prototype InstallLibs();


....................All the normal stuff that follow.....................................................

//---------------------------------------------------------------------------
// OnEnd
//
// The OnEnd event is called at the end of the setup. This event is not
// called if the setup is aborted.
//---------------------------------------------------------------------------
function OnEnd()
begin
 InstallLibs();
end;

//Install Libraries
function InstallLibs()
string Libraries;
begin
Libraries = SRCDIR ^ @ID_FILENAME_RAPTURE3D_SETUP;
if (LaunchAppAndWait (SRCDIR ^ "Libraries\\Rapture3D.exe", "/SILENT", WAIT) < 0 ) then
    SprintfBox( SEVERE, "", "Rapture3D Setup not found!", Libraries );
endif;
end;


I bold there what I've added.
I have deiced to make them install at last.
But, the effect is the same i guess.

Thank you a lot Rita!


Edit:

Sorry for brothering you again.
But, i noticed that when i uninstall my app, the libraries installs again.
I have changed now the function to be called when "OnMoving" but it is the same.
How i do to make installshield not to call my function when uninstalling?

Thank you again.

Best Regards.
MerolaC

Edited by MerolaC, 22 April 2010 - 20:00.


Maharani

Maharani
  • Full Members
  • 50 posts

Posted 23 April 2010 - 08:05

Hi,

the OnEnd function is probably not the correct place to do that, because it's called at the end of the Setup. Maybe there are predefined constants like REMOVEALLMODE but I don't know which of these are available in OnEnd. Search online help for "Predefined constants" and have a look at the list, although the explanation for these variables is rather not helpful.
You can check the available functions in the AfterMoveData-ComboBox in the scripting editor and select the one you need:
OnFirstUIAfter will be called after a first time installation - this is where you should put your code
OnMaintUIAfter will be called after maintenance (Repair/Modify/Deinstall). You will have to check for REMOVEALLMODE in this function to trigger actions you want to do after a Repair or Modify only
OnUpdateUIAfter will be called after an Update (i.e. when you have installed version 1 and start setup.exe of version 2 the software will be updated to that version)
You will need to call your InstallLibs() in OnMaintUIAfter and OnUpdateUIAfter only if the Rapture3D-version is changing often and the user needs to update this software when he updates your software. Otherwise OnFirstUIAfter will be sufficient.

Regards
Rita


MerolaC

MerolaC
  • Full Members
  • 5 posts

Posted 23 April 2010 - 16:29

Hi. Thanks again Rita.
Everything solved and working perfectly! Thank you.

I put the code on "OnFirstUIAfter" and everything is perfect

Thank you a lot for your time.
I learned a lot thanks to you.

Have a good day!
And again,
Thank you!

Best regards.
MerolaC