Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: When is the determination of whether a file is in in use?

  1. #1

    Default When is the determination of whether a file is in in use?

    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

  2. #2

    Default Re: When is the determination of whether a file is in in use?

    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

  3. #3

    Default Re: When is the determination of whether a file is in in use?

    Thank you Friedrich. I think I've got it now.

    Jeff Slarve

  4. #4

    Default Re: When is the determination of whether a file is in in use?

    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.

  5. #5

    Default Re: When is the determination of whether a file is in in use?

    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

  6. #6

    Default Re: When is the determination of whether a file is in in use?

    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

  7. #7

    Default Re: When is the determination of whether a file is in in use?

    Thanks Glenn -

    I looked for anything except for program files, and I don't see
    anything extra. I appreciate the idea, though.

    Jeff Slarve

  8. #8

    Default Re: When is the determination of whether a file is in in use?

    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

  9. #9

    Default Re: When is the determination of whether a file is in in use?

    Thanks Friedrich. That's not what it was. Must have been a Jeff
    problem.

    Seems to be okay now.

    Jeff Slarve

  10. #10

    Default Re: When is the determination of whether a file is in in use?

    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •