PDA

View Full Version : How to detect that a re-boot is required?



NewsArchive
03-02-2016, 01:53 AM
Howdy -

I want to detect that a re-boot was required because of in-use file
replacement.

Q1: How do I detect that the reboot was required?
Q2: If the reboot IS required, will I get an opportunity to create a
text file?
Q3: How do I detect that the reboot was actually done and that the
setup has successfully completed as a result of that reboot?

Thank you.

Jeff Slarve
www.jssoftware.com
Twitter free since Jan 11, 2016
I'll search help files & Google for you.

Grammar troll's, are the worse.

NewsArchive
03-02-2016, 01:54 AM
I came across this snippet in that fabulous ancillary "Learning SetupBuilder
Part I" document ;-)
Might help with part of the question...

- jf

NewsArchive
03-02-2016, 06:04 AM
Hi Jeff,

Interesting questions!

In addition to what Jane said, here are your options.

> I want to detect that a re-boot was required because of in-use file
> replacement.
>
> Q1: How do I detect that the reboot was required?

If a re-boot for the PRODUCT is required because of in-use file replacement,
the value of the %_SB_INSTALLERFLAG% variable will be "1" for the
$SB_RESTARTFLAG$ flag. See ***ANSWER A*** in the attached screenshot.

To detect if there is a pending reboot for the COMPUTER (e.g. from another
install), you can use the "Get System Info (Reboot Status)" script function.
See ***ANSWER B*** in the attached screenshot.

> Q2: If the reboot IS required, will I get an opportunity to create a
> text file?

Yes, absolutely no problem. See ***ANSWER C*** in the attached screenshot.

> Q3: How do I detect that the reboot was actually done and that the
> setup has successfully completed as a result of that reboot?

The "problem" is that the user should decide whether to reboot now or later.

To detect (from the installer) that the reboot was actually done and that
the setup has successfully completed as a result of that reboot, you have to
"auto resume" the installer. You can then detect the restart action. See
***ANSWER E*** in the attached screenshot. The build-in %_SB_RESUME%
installer variable value is set to "1" if installer resume is enabled.

What do you think?

Friedrich

NewsArchive
03-02-2016, 11:05 AM
Thanks Jane!

Jeff Slarve
www.jssoftware.com
Twitter free since Jan 11, 2016
I'll search help files & Google for you.

Grammar troll's, are the worse.

NewsArchive
03-02-2016, 11:05 AM
Hmm. Interesting. Thank you very much! I will probably have questions
later.<g>

Jeff Slarve
www.jssoftware.com
Twitter free since Jan 11, 2016
I'll search help files & Google for you.

Grammar troll's, are the worse.

NewsArchive
03-03-2016, 01:42 AM
Hi Friedrich -

Is it possible (before the end of the setup) to enumerate the in-use
files that will be installed on re-boot?

Jeff Slarve
www.jssoftware.com
Twitter free since Jan 11, 2016
I'll search help files & Google for you.

Grammar troll's, are the worse.

NewsArchive
03-03-2016, 01:42 AM
Jeff,

> Is it possible (before the end of the setup) to enumerate the in-use
> files that will be installed on re-boot?

It's under Compiler Directives...

#kitchensink









<g>

Lee White

NewsArchive
03-04-2016, 12:46 AM
Hi Jeff,

> Is it possible (before the end of the setup) to enumerate the in-use
> files that will be installed on re-boot?

You have to read the "PendingFileRenameOperations" registry value to get the
list of files. Problem is that each "line" in the value data is null
terminated and the whole thing is a double-null string.

Perhaps I can add a SB function to handle this. I'll investigate and let
you know.

Friedrich

NewsArchive
03-04-2016, 12:47 AM
Thanks Friedrich -

I've worked with null delimited strings that are double-null
terminated. I'll give it a shot.

Thanks.

Jeff Slarve
www.jssoftware.com
Twitter free since Jan 11, 2016
I'll search help files & Google for you.

Grammar troll's, are the worse.

NewsArchive
03-04-2016, 12:47 AM
on my Windows 8.1 machine, under
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Session
Manager\PendingFileRenameOperations, the data that's currently in
there is apparently delimited by 2 sets of CRLF ('<0Dh,0Ah,0Dh,0Ah>')
per listed file.

Jeff Slarve
www.jssoftware.com
Twitter free since Jan 11, 2016
I'll search help files & Google for you.

Grammar troll's, are the worse.

NewsArchive
05-19-2016, 05:55 AM
>> Is it possible (before the end of the setup) to enumerate the in-use
>> files that will be installed on re-boot?
>
> You have to read the "PendingFileRenameOperations" registry value to
> get the list of files. Problem is that each "line" in the value data
> is null terminated and the whole thing is a double-null string.
>
> Perhaps I can add a SB function to handle this. I'll investigate and
> let you know.

I have added it to the latest internal build.

Friedrich

NewsArchive
05-19-2016, 05:56 AM
Suite

Jeff Slarve
www.jssoftware.com
Twitter free since Jan 11, 2016
I'll search help files & Google for you.

Grammar troll's, are the worse.

NewsArchive
08-09-2016, 10:30 AM
>>> Is it possible (before the end of the setup) to enumerate the in-use
>>> files that will be installed on re-boot?
>>
>> You have to read the "PendingFileRenameOperations" registry value to
>> get the list of files. Problem is that each "line" in the value data
>> is null terminated and the whole thing is a double-null string.
>>
>> Perhaps I can add a SB function to handle this. I'll investigate and
>> let you know.
>
> I have added it to the latest internal build.

Unfortunately, it turned out it did not work as expected and I had to
"disable" the new feature. But it will be available in the next build.

Friedrich