Page 1 of 1

Reboot and continue at specified point?

Posted: Thu Mar 21, 2013 4:52 am
by anja_laenge
Hi,

I have the following situation:
during setip process I am looking for a specific named instance of sql2005 and uninstall it via its productcode ( Install/Remove MSI Package $OLDSQLPRODUCTCODE$[REMOVE=ALL] ).
After that is done I install a new named instance of sql2008r2.

This works on Windows7 machines but under WinXP SP3 the installation of sql2008r2 fails. The setup log tells me the following:

RebootRequiredCheck
Checks if a pending computer restart is required. A pending restart can cause Setup to fail.
Failed
A computer restart is required. You must restart this computer before installing SQL Server.


The computer was rebootet before because prerequisites installation required it.
So my assumption is that this OS needs a reboot after the deinstallation of the sql2005.

At this time the user has already made some decisions which influence the course of the installation.
How can I enforce a neccessary reboot and make the setup continue at this point with the variable values corresponding to the decisiions the user made?

I am using the native engine, native logging is active at this point.


Thanks in advance.

Re: Reboot and continue at specified point?

Posted: Thu Mar 21, 2013 8:29 am
by FrancescoT
Dear User,

I can only suggest you to store somewhere (using a file, under registry and so on) those information and then, verify if those are stored when installation begins.
In this way you should be able to know, if you setup has restarted after a reboot that you previously forced and then if true, continue the package installation following your requirements.

Regards

Re: Reboot and continue at specified point?

Posted: Fri Mar 22, 2013 7:59 am
by anja_laenge
FrancescoT wrote:I can only suggest you to store somewhere (using a file, under registry and so on) those information and then, verify if those are stored when installation begins.
In this way you should be able to know, if you setup has restarted after a reboot that you previously forced and then if true, continue the package installation following your requirements.


Okay. This brings up some other questions:
Can I use labels and GoTos from and to anywhere in all the contained scripts?
What about variables? Setting a variable I can tell the setup to remember the value when resuming setup. When I get an operations result into a variable I can not set this option. Do I have to store these elsewhere (file/registry/whatever)?
Are my variables globally accessible? Does every script know the values of variables in other scripts?

Re: Reboot and continue at specified point?

Posted: Fri Mar 22, 2013 10:42 am
by FrancescoT
Dear User,

Okay. This brings up some other questions:
Can I use labels and GoTos from and to anywhere in all the contained scripts?

Yes, but be careful with a massive use of GOTO statements .
These can generate generate errors if not used properly, as happens with any development language.

What about variables? Setting a variable I can tell the setup to remember the value when resuming setup. When I get an operations result into a variable I can not set this option. Do I have to store these elsewhere (file/registry/whatever)?

The variables value are stored only if the setup completes (Persistent Variable).
You could store your variables using custom REGYSTRY KEYS, that you can read when your setup resumes after a restart.

Are my variables globally accessible? Does every script know the values of variables in other scripts?

Yes, any variable is accessible by your scripts if declared before the script inclusion.

Regards

Re: Reboot and continue at specified point?

Posted: Mon Mar 25, 2013 6:21 am
by anja_laenge
FrancescoT wrote:
Okay. This brings up some other questions:
Can I use labels and GoTos from and to anywhere in all the contained scripts?

Yes, but be careful with a massive use of GOTO statements .

How is the integration of the scripts taking place?

Assuming I have a structure like the following:
  • MainScript
    • includedScript_One
  • ... (continuing MainScript)
    • includedScript_Two
  • ...

and at the beginning of the MainScript I check my registry key, decide that this is a resuming setup and use a GoTo that points to a label in includedScript_One; where will the setup continuie when includedScript_One is completed?

What about variables? Setting a variable I can tell the setup to remember the value when resuming setup. When I get an operations result into a variable I can not set this option. Do I have to store these elsewhere (file/registry/whatever)?

The variables value are stored only if the setup completes (Persistent Variable).
You could store your variables using custom REGYSTRY KEYS, that you can read when your setup resumes after a restart.

I inserted a "Reboot Computer and Resume Setup after Login (requires manual user approval starting with Windows Vista)". the computer restartet but setuo didn't resume after the login. Is there something else I have to do to make the setup resume?

Re: Reboot and continue at specified point?

Posted: Mon Mar 25, 2013 8:53 am
by FrancescoT
Dear User,

where will the setup continuie when includedScript_One is completed?

Just after the Include script commad is placed in your code sequence.

Code: Select all

Is there something else I have to do to make the setup resume?

No ... nothing else ... Just the call to "Reboot Computer and Resume Setup" command.

Regards

Re: Reboot and continue at specified point?

Posted: Mon Mar 25, 2013 10:48 am
by anja_laenge
Hi Francesco,

FrancescoT wrote:

Code: Select all

Is there something else I have to do to make the setup resume?

No ... nothing else ... Just the call to "Reboot Computer and Resume Setup" command.


using 'Reboot Computer and Resume' the PC reboots and resumes the setup but with a totally black screen... I can watch the setup and the sqlsetup it called in the taskmanager, but the screen stays black for several minutes until both setups are finished.
Using 'Reboot Computer and Resume Setup after Login' brings up the desktop but the Setup does not resume.

How can I make the setup resume with somekind of visual feedback to the user?

Re: Reboot and continue at specified point?

Posted: Mon Mar 25, 2013 12:08 pm
by FrancescoT
Dear User,

I can only suppose there is something wrong with the way you are doing, the setup is always resumed with the package UI (...unless you skip the UI via script).

If you want, try to post a very simple project that replicates your issue and I'll try to see what happens.

Regards

Re: Reboot and continue at specified point?

Posted: Tue Mar 26, 2013 12:49 am
by anja_laenge
FrancescoT wrote:I can only suppose there is something wrong with the way you are doing, the setup is always resumed with the package UI (...unless you skip the UI via script).

That was exactly the point. After calling the ProgressDialog in case of being in a resume this now works at it should.

Thank you very much for your support and input!

Re: Reboot and continue at specified point?

Posted: Tue Mar 26, 2013 8:02 am
by FrancescoT
:D