PDA

View Full Version : File selection at runtime



kevinb
03-12-2012, 08:46 AM
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

linder
03-12-2012, 09:57 AM
Kevin,

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

Friedrich

kevinb
03-12-2012, 09:58 AM
Wonderful! Thanks!

Kevin

linder
03-12-2012, 10:28 AM
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

kevinb
03-12-2012, 11:28 AM
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

kevinb
03-12-2012, 05:25 PM
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

linder
03-13-2012, 01:02 AM
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

kevinb
03-13-2012, 10:04 AM
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

linder
03-13-2012, 10:17 AM
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

kevinb
03-13-2012, 10:19 AM
Ok, I'll see what the log says and let you know! :)

Kevin

linder
03-13-2012, 10:24 AM
Or as an additional test, create a simple new "dummy" project, add one or two folders, compile and install. Then uninstall and you'll see that the folders are gone... :)

Friedrich

kevinb
03-13-2012, 10:38 AM
The uninstall log looks normal and shows the directory tree and files in them. Not sure what would be missing.

Kevin

linder
03-13-2012, 11:25 AM
Kevin,

Did you try a simple "dummy" project? Just create a new project, add a test folder tree, then compile and install/uninstall. Does this uninstall the folder tree on your machine?

Friedrich

kevinb
03-13-2012, 11:29 AM
I havent done that yet but will shortly.

Kevin

kevinb
03-13-2012, 12:51 PM
Ok a hidden file was being left behind that was created when an app ran. Oy. I'm good now. Next question. Can the web update/delta patches be used against a single directory? What I want to do is a full install of a WAMP stack that includes our PHP application. Once installed the WAMP stuff wont change, only the application itself, so only the directory thats in will change. Maybe create a web install version as well. Thanks!

Kevin

linder
03-14-2012, 01:42 AM
Hi Kevin,

It all depends on your deployment strategy. A patch file is an update or revision file that contains only the differences between two or more files. Since the patch file contains only the changes, it is a much quicker and economic method of distributing revisions. You can patch files in multiple-folders.

But do you really have to use binary patch here? As I understand it, using delta-patch would over-complicate things in your case.

Friedrich

kevinb
03-14-2012, 10:06 AM
Yeah I think since the application files are actually php it's easier to actually save the install directory in a reg entry and then just create an "update" installer that looks at the entry and just overwrites all the php files when its run. The way the app works is when you manually overwrite all the files (except the db config) and run it the first time it self-upgrades, so I think above is the easiest way to accomplish the update.

Kevin

linder
03-14-2012, 11:52 AM
Hi Kevin,

You can create a "stand-alone" upgrade or "live-update" (web update) project for this, no problem. But IMO, it does not make much sense to make use of the binary patch (delta update) feature in this case. The compiler will already highly compress your php. And if the expected "bandwidth saving" is not at least 500MB - 1GB then I would avoid the extra layer of complexity imposed by delta patching.

BTW, the install folder is automatically stored. The "Detect Previous Version..." script function lets you detect the path (and even version) of a previously distributed version of your product ;)

Friedrich

kevinb
03-14-2012, 12:21 PM
I agree, the delta patches are not needed. The "update installer" makes more sense along with detecting the previous version. Possibly making a web installer to be used the first time, so if they dont have the wamp stack installed it pulls it all, otherwise it just pulls the new php and updates?

Kev

kevinb
03-14-2012, 05:39 PM
How can I add multiple checkboxes on one panel? I have 3 options I'd like to place checkboxes for on 1 panel. I'm having trouble on how I'm supposed to do that. If I add a wizard dialog in scripting and try and do it that way it places each checkbox on its own panel. Thanks!

Kevin

linder
03-15-2012, 12:59 AM
Hi Kevin,

I would suggest to download the "Examples Package" and the "Learning SetupBuilder Part I".

The "Check Box Dialog.sb7" and/or the "Custom Dialog Demo 1.sb7" (if you need custom dialogs) demo projects should do what you want.

Does this help?

Friedrich