+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: File selection at runtime

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2011
    Location
    New Jersey
    Posts
    26

    Question File selection at runtime

    Fred,
    I want to have 2 versions of the same file in the installer and write only one of them to the install directory (it's a config file with a different option set internally) based on whether the user checks a box or not. Can this be done? I've been looking around but haven't figured out where this needs to be done. Possibly the scripting area? Thanks!

    Kevin

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: File selection at runtime

    Kevin,

    Absolutely no problem. I'll develop a demo script for you later today.

    Friedrich

  3. #3
    Join Date
    Jun 2011
    Location
    New Jersey
    Posts
    26

    Default Re: File selection at runtime

    Wonderful! Thanks!

    Kevin

  4. #4
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: File selection at runtime

    Kevin,

    See attached .sb7 project and screenshot. Based on the selection, the installer will install FILE_A or FILE_B (you can use the same file name for the different files here).

    Does this help?

    Friedrich
    Attached Images Attached Images  
    Attached Files Attached Files

  5. #5
    Join Date
    Jun 2011
    Location
    New Jersey
    Posts
    26

    Default Re: File selection at runtime

    That looks like it should do what I need. I'll give it a spin and let you know if I have an problems. Thanks!

    Kevin

  6. #6
    Join Date
    Jun 2011
    Location
    New Jersey
    Posts
    26

    Default Re: File selection at runtime

    Ok, that works. Thanks! Next question. When I uninstall, all the files get removed no problem, but it is still leaving the directory tree there. Am I missing something obvious here??

    Kev

  7. #7
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: File selection at runtime

    Kevin,

    Three different possible reasons for this:

    1. The installer did not create the folder and so it does not remove it. You can write a custom uninstall to handle this scenario and remove files and subfolders not created by the installer.

    2. You do not log the folder creation in the uninstall .log

    3. A "process" is still active and the "current folder" of the process is set to that directory. As a result, the folder can't be removed (is locked).

    Does this help?

    Friedrich

  8. #8
    Join Date
    Jun 2011
    Location
    New Jersey
    Posts
    26

    Default Re: File selection at runtime

    The directories are the ones specified and used in the installer. The software doesn't create and additional directories. When I uninstall all FILES are removed fine, just not the directory tree. As for logging the directory creation I thought SB did that when I defined the install directory in the project. Maybe I'm missing something? Nothing is running when I uninstall. Is there a way to force the deletion maybe? Thanks.

    Kevin

  9. #9
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: File selection at runtime

    Kevin,

    If the installer created the folder and the folder is empty (and not "locked", e.g. by a virus-scan process) then the uninstaller will automatically remove the folder.

    I would suggest to check the uninstall .log file to see if you are logging the create folder actions.

    BTW, as a simple test, uninstall SetupBuilder. It will remove all of it's own files and the folder tree and then the uninstall kills itself

    Friedrich

  10. #10
    Join Date
    Jun 2011
    Location
    New Jersey
    Posts
    26

    Default Re: File selection at runtime

    Ok, I'll see what the log says and let you know!

    Kevin

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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