View Full Version : When is the determination of whether a file is in in use?
NewsArchive
01-27-2010, 02:36 AM
I am using SB 7 to update a program that is usually going to be
already running at the time that the setup is started.
Since this particular program may or may not be running as a service,
I call Clarion code in a support dll to shut my application down
before the installation continues.
Despite the fact that my program is already terminated by the time the
files get installed, I still get a prompt that a re-boot is needed.
What can I do so that this isn't necessary?
If the service is not running when the setup is run, then I do not get
a reboot message.
Thanks.
Jeff Slarve
NewsArchive
01-27-2010, 02:38 AM
Hi Jeff,
> I am using SB 7 to update a program that is usually going to be
> already running at the time that the setup is started.
>
> Since this particular program may or may not be running as a service,
> I call Clarion code in a support dll to shut my application down
> before the installation continues.
>
> Despite the fact that my program is already terminated by the time the
> files get installed, I still get a prompt that a re-boot is needed.
>
> What can I do so that this isn't necessary?
>
> If the service is not running when the setup is run, then I do not get
> a reboot message.
You can use the "Check In-use File..." and "Check In-use Folder Tree..."
functions to check if files are in-use (active or locked).
If a file cannot be replaced during the file installation process (access
denied), it is logged and Windows has to replace it after a restart.
If the reboot message is displayed (and you do not force a reboot
programmatically from your script) then at least one existing file was
locked. In your case, I assume your service is still running (doing some
shut-down activities). Can't you use the Service functions in SetupBuilder
to stop the service? Then give a few seconds for shutdown, check again
(from SetupBuilder using "Check Service...") whether the service is still
active, then (to be on the safe side), use "Check In-use File..." on the
service file. Do this in a Loop and you should be done. If, say, after 4
or 5 "retries" the service is still active or the file is still locked,
display a message stating that the service can't be shut-down yada yada and
a reboot might be required at the end of the installation process. Or even
terminate the install to avoid a required reboot.
Does this help?
Friedrich
--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910
SetupBuilder is Windows 7 installation -- "point. click. ship"
-- Official Comodo Code Signing and SSL Certificate Partner
NewsArchive
01-28-2010, 02:37 AM
Thank you Friedrich. I think I've got it now.
Jeff Slarve
NewsArchive
01-28-2010, 02:38 AM
Jeff,
I had similar issues while working with one of my more recent installs, and
like you, thought it was related to my service. After long hours of pulling
my hair out, I discovered that my server was doing fine, and it was actually
web links that were causing my reboot. I had two shortcuts in my startup
folder to web pages which for what ever reason, will not replace during an
install. In fact, they will not delete on an uninstall either. My solution
was get rid of the links.
My point, is make sure your service is causing the problem, and definitely
don't jump to conclusions... will save you hours of debugging.
Thanks,
-Glenn.
NewsArchive
01-29-2010, 02:25 AM
Friedrich -
Is there any way to determine why Setupbuilder deemed it necessary to
reboot?
As far as I can tell, the Check-for-in-use keeps coming back as false,
but sometimes it still requires a re-boot.
When the reboot is completed, it appears that some of the files are
missing, which is remedied on re-install.
Jeff Slarve
NewsArchive
01-29-2010, 02:26 AM
My mistake. Seems to be working well, now that I am checking for the
correct return value<g>.
However, I have had a strange thing happen a couple of times, where
the "in use" thing would keep returning true, but my process was dead
in taskmanager.
It seemed to keep on showing as in-use until the installer exited,
then it worked fine after the installer was re-run.
I have no idea why that happens, but it usually works fine.
Jeff Slarve
NewsArchive
01-29-2010, 02:27 AM
Thanks Glenn -
I looked for anything except for program files, and I don't see
anything extra. I appreciate the idea, though.
Jeff Slarve
NewsArchive
01-30-2010, 03:12 AM
Hi Jeff,
> However, I have had a strange thing happen a couple of times, where
> the "in use" thing would keep returning true, but my process was dead
> in taskmanager.
>
> It seemed to keep on showing as in-use until the installer exited,
> then it worked fine after the installer was re-run.
>
> I have no idea why that happens, but it usually works fine.
Please see:
http://www.lindersoft.com/forums/showthread.php?t=22062
---
[SB#911161] Installer: Under certain circumstances, the "Check Service (Is
Service Running)" script function did not close the service handle.
---
If you are using the "Check Service" function, then it's well possible that
this causes it.
Friedrich
NewsArchive
01-30-2010, 03:12 AM
Thanks Friedrich. That's not what it was. Must have been a Jeff
problem.
Seems to be okay now.
Jeff Slarve
NewsArchive
01-30-2010, 03:13 AM
Setupbuilder, as far as software-development types of apps goes, is
probably the nicest application I've used.
You've really done a tremendous job.
Jeff Slarve
NewsArchive
01-30-2010, 03:25 AM
> Setupbuilder, as far as software-development types of apps goes, is
> probably the nicest application I've used.
>
> You've really done a tremendous job.
Thank you so much for your kind words, Jeff!
Friedrich
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.