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
Re: File selection at runtime
Kevin,
Absolutely no problem. I'll develop a demo script for you later today.
Friedrich
Re: File selection at runtime
2 Attachment(s)
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
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
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
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
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
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
Re: File selection at runtime
Ok, I'll see what the log says and let you know! :)
Kevin