cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Superfreak3
Level 11

Accessing ReplacedInUseFiles property during Execute Sequence...

Hi all,

I'm trying to change a current install widget to behave differently if the need for a reboot has been detected. I'm trying to leverage ReplacedInUseFiles for this purpose, but in testing, I cannot display its value. I do see in the log that the property is added and set to 1 as a file in my test install is in use.

My main goal was to pass ReplacedInUseFiles to a Custom Action 'widget'. If set to 1, do something, else, do another task.

Can anyone tell me how I can gain access to and use ReplacedInUseFiles or is there another way to detect a reboot, which can be passed to my CA?

Any information is appreciated.

Thanks!
Labels (1)
0 Kudos
(7) Replies
Superfreak3
Level 11

I created a small dummy install that places a Hello World win form app. I simply start the app then run an updated installer over top to force the file in use issue. In this install, I eventually got it to function by adding an InstallExecute action immediately following ScheduleReboot. Then, after the InstallExecute action, I created an Immediate Execute custom action that grabbed ReplacedInUseFiles and set a new Public Property to its value.

I pass this new Public Property to my Execute Deferred .exe and it seems to work great.

Now, using this as a model, I add this stuff to my 'real' installation template, compile and test - no go!!! The deferred .exe is not really getting the correct value as the Immediate Action does not seem to be getting the correct value of ReplacedInUseFiles. This would again indicate that it has not been set/detected files in use. The property is set to 1 in the verbose log.

I have no idea what is going on AGAIN! There has got to be an easier way to determine if a reboot is needed.

So, still looking for help!
0 Kudos
Superfreak3
Level 11

Here's is where I am at currently... I'm trying to test my latest changes and I answer No to close apps on the Restart Manager dialog, which should require a reboot. From the log it seems to set the associated RestartManagerOption property to Reboot.

However, later in the log, it indicates that ScheduleReboot is skipped as the condition is false. The condition on my ScheduleReboot action is ISSCHEDULEREBOOT. I don't know why this isn't getting set properly to trigger the reboot. ???

My test consists of installing an earlier version, launch one of the .exe then initiate a Major Upgrade. This does see the file in use and displays the Restart Mgr dialog as mentioned.

The issue here is that I want my install to reboot only when needed - not always forced to reboot. I just want to be able to test my ancillary installer fired at the end of our main install if a reboot is needed. In this scenario, where there is no reboot the secondary installer runs without issue - the widget that fires it is not killed by a reboot. However, I would like to know why a reboot isn't initiated for me when a file is in use.
0 Kudos
Superfreak3
Level 11

I think I may have stumbled onto something. I first thought maybe Restart Manager was doing something funky causing the need for reboot not to be there in the end. However, I think I may have found something Here...

Question
What happens if a user does not shut down the app thus the files remain in use?

Answer
A verbose log will include one or more of the errors 1603, 1732, 1902, 1903, 3010 (per Logging of Reboot Requests [Windows Installer], Windows Installer Error Messages [Windows Installer] and Error Codes [Windows Installer]). If the file isn’t hard locked, then the windows installer will move the in use file to the rollback cache and place the new file in the place of the in use file. If the move to the rollback directory is blocked (by hard locking) the PendingFileRenameOpertions hive is used. For the former case, shutting down and restarting the app is required. For the latter case, rebooting the OS is required.

I'm guessing the app file I launch to hopefully cause a reboot condition is being moved to the roll back cache.

Now to figure out how to cause a hard lock condition so I can test my changes if a reboot is really prompted.
0 Kudos
Stefan_Krueger
Level 9

I'm not sure, but the problem might be that the key isn't being written (at the time you expect it) - you can check this with Process Monitor - or the property is being set (for instance, a deferred custom action can't communicate back tot the install).
Why don't you simmply read the registry key in your exe instead of your installer?
Stefan Krueger
InstallSite.org
0 Kudos
Superfreak3
Level 11

Stefan Krueger wrote:

Why don't you simmply read the registry key in your exe instead of your installer?


At this point I'm not quite sure what registry key you are referring too. I think I am able to determine when a reboot is needed and I can deal with my secondary installer accordingly.

Now I simply have to trick my installer during tests so it detects a hard lock condition so I can ensure my changes will function as expected.
0 Kudos
Superfreak3
Level 11

Here's the latest in the saga....

On several machines, I've noticed the following message on uninstalls while trying to test my other changes...

"The setup must update files or services that cannot be updated while the system is running. If you choose to continue, a reboot will be required to complete the setup."

If OK is selected, the uninstall runs to completion with no reboot.

I do see in the log that a need for reboot has been detected, but I don't see any clue as to what may be triggering this need. I search for some related error codes like 1603, 1732, 1902, 1903, 3010, but nothing. There are also no services as part of this app install/uninstall.

All of my reboot changes posted earlier are conditioned to run if Not Installed and VersionNT64 so I don't believe any of my changes are coming into play here. I even tested this by using an early backup that didn't contain any related reboot handling changes and received the same result.

I then thought that Restart Manager might be doing something 'funky'. I added MSIRESTARTMANAGERCONTROL=1 to the Property table, installed then uninstalled = NO MESSAGE!

So, it appears Restart Manager is involved. I could simply set the control property as stated above and be done with it an simply rely on the older Files In Use mechanism, but I would like to know what is causing the issue on some machines. I'm perplexed as to what Windows Installer is detecting as in on uninstall. I was hoping the log would show, but nope.

Any help appreciated!!
0 Kudos
Superfreak3
Level 11

What are the pros/cons of disabling Restart Manager?
0 Kudos