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

Thread: How to warn if file is in use?

  1. #1

    Default How to warn if file is in use?

    I make quite a lot of services that run on a server. I would like to avoid a
    restart of the server when installation is finished. How can I force the
    user to close my programs before continuing installation?

    Thanks
    Bjarne

  2. #2

    Default Re: How to warn if file is in use?

    Bjarne,

    You can use the "Check In-use File" and/or "Check In-use Folder Tree"
    functions to handle this.

    You can even use the above function(s) in a Loop to make sure the user
    really closed the applications.

    Does this help?

    Friedrich

    --
    Friedrich Linder
    Lindersoft
    www.lindersoft.com
    +1.954.252.3910

    "point. click. ship" - that's SetupBuilder 6.5
    Create Windows Vista ready installations in minutes

    -- Official Comodo Code Signing and SSL Certificate Partner

  3. #3

    Default Re: How to warn if file is in use?

    Yes, it helped - forced me to learn how to work with scripts there...
    Tried Check In-Use Folder tree too, but I am unable to display the result
    %_SB_RETURNEX%



    [ Install Files ]
    Loop (3 Times)
    Set Variable %INUSE% to FUNCTION:Check In-use File
    "%_SB_INSTALLDIR%\ADIBARSCAN.EXE"
    If %INUSE% Equals "1" Then
    Display Message Box "AdiBarscan.exe is reported in use.\nClose the
    appl..." -- "File In Use"
    Else
    Break Loop
    End
    End
    If %INUSE% Equals "1" Then
    Exit Installation 0
    End

    Bjarne Havnen

  4. #4

    Default Re: How to warn if file is in use?

    %_SB_RETURNEX% returns a list of filename(s) in use. You can display it in
    a List Box dialog. Or you can use "Handle String Function" -> Count List
    Items / Get List Item, etc. to do specific things with specific file items.

    Friedrich

  5. #5

    Default Re: How to warn if file is in use?

    For example (see attached screenshot).

    I'll also attach the project to this thread. The project will check the
    c:\clarion6\bin folder for in-use files. Start Clarion and compile/run the
    SetupBuilder project.

    Does this help?

    Friedrich
    Attached Images Attached Images  

  6. #6

    Default Re: How to warn if file is in use?

    SetupBuilder 6.5 Developer Edition demo script.

    --
    Friedrich Linder
    Lindersoft
    www.lindersoft.com
    +1.954.252.3910

    "point. click. ship" - that's SetupBuilder 6.5
    Create Windows Vista ready installations in minutes

    -- Official Comodo Code Signing and SSL Certificate Partner
    Attached Files Attached Files

  7. #7

    Default Re: How to warn if file is in use?

    I was struggling a little to find the correct place for the code when
    checking directory. If I want to check my install directory, I can't place
    it before installing files. I belive this might be because the installation
    logfile is created and opened by setup. So I need the location after
    selecting directory, but before using files. Seems that before creating the
    uninstall log is ok.

    I'll look into the rest of your suggestions a little later.

    Bjarne

  8. #8

    Default Re: How to warn if file is in use?

    Do it in the "Loop Wizard" that displays your Welcome, License, Select
    Dialog, etc. dialogs. This is before you modify anything on the target
    machine!

    If you need help, just let me know.

    Friedrich

  9. #9

    Default Re: How to warn if file is in use?

    I'm sorry, but I think I have to read some more docs. I don't understand
    how to position the code in the right place
    This is my dialogs. I should have the code after #3 or #5, but you say in
    Loop Wizard. Where in the docs can I find it explained how to know which
    dialog is finished?

    ! Wizard dialog definition(s)
    Define Wizard Dialog "#1" (Welcome)
    Define Wizard Dialog "#2" (Password)
    Define Wizard Dialog "#3" (Select Install Folder) (%_SB_INSTALLDIR%)
    Define Wizard Dialog "#4" (Custom Install)
    Define Wizard Dialog "#5" (Ready to Install)

    ! The Wizard Loop displays the dialog screens that the user sees in the
    installation
    Loop Wizard (Abort Dialog Active)
    !should I place code within here???
    End

    Bjarne Havnen

  10. #10

    Default Re: How to warn if file is in use?

    I would suggest to check the "Dialog 2.sb6" demo script in the Examples
    package. A script says more than 100 pages in the manual <g>.

    You'll end doing something like that:

    Loop Wizard (Abort Dialog Active)
    !should I place code within here???
    If %_SB_DIALOGID% Equals "3" Then
    !yadayada
    END
    End

    Just add the dialog that displays the in-use files to the list of your
    dialogs. Then hide it and only display it when you have detected in-use
    files.

    Very easy to do with only 6-8 lines of code. If you need help, just shout.

    Friedrich

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
  •