Reboot and continue at specified point?

Got a problem you cannot solve? Try here.
anja_laenge
Posts: 121
Joined: Tue Nov 20, 2012 1:02 am

Reboot and continue at specified point?

Postby anja_laenge » Thu Mar 21, 2013 4:52 am

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.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Reboot and continue at specified point?

Postby FrancescoT » Thu Mar 21, 2013 8:29 am

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

anja_laenge
Posts: 121
Joined: Tue Nov 20, 2012 1:02 am

Re: Reboot and continue at specified point?

Postby anja_laenge » Fri Mar 22, 2013 7:59 am

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?

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Reboot and continue at specified point?

Postby FrancescoT » Fri Mar 22, 2013 10:42 am

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

anja_laenge
Posts: 121
Joined: Tue Nov 20, 2012 1:02 am

Re: Reboot and continue at specified point?

Postby anja_laenge » Mon Mar 25, 2013 6:21 am

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?

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Reboot and continue at specified point?

Postby FrancescoT » Mon Mar 25, 2013 8:53 am

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

anja_laenge
Posts: 121
Joined: Tue Nov 20, 2012 1:02 am

Re: Reboot and continue at specified point?

Postby anja_laenge » Mon Mar 25, 2013 10:48 am

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?

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Reboot and continue at specified point?

Postby FrancescoT » Mon Mar 25, 2013 12:08 pm

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

anja_laenge
Posts: 121
Joined: Tue Nov 20, 2012 1:02 am

Re: Reboot and continue at specified point?

Postby anja_laenge » Tue Mar 26, 2013 12:49 am

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!

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Reboot and continue at specified point?

Postby FrancescoT » Tue Mar 26, 2013 8:02 am

:D
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 113 guests