Thursday, September 16, 2010

WIP: BestInstaller

I mentioned before that I wanted to write an installer that asks the user everything, and I did. I kinda stayed up way too late and wrote almost the entire installer in one night, then later I started working on a GUI to create a custom one.

It's a pretty simple concept, which is why it was so easy to write. A BestInstaller installer will ask the user about the following:
  • The destination
  • (Optional) A license
  • (Optional) A standard vs a portable install
    • A customized config file for the portable install
  • (Optional) The Start Menu shortcuts
    • Either a group (folder) or just an individual shortcut
    • Either for the current user or all users
  • (Optional) What filetypes to associate
    • Either for the current user or all users
  • (Optional) A startup folder shortcut
    • Either for the current user or all users
  • (Optional) A Desktop shortcut
    • Either for the current user or all users 
  • (Optional) A Quicklaunch shortcut
  • (Optional) A "Donate to the author" button

The cool thing about it is that it basically uses a "template" file, and let's the user define variables/options. So each individual file has only 25 lines of code, and then it just includes the template, and boom, you have a working installer.

The only "problem" I've really had is trying to get Autohotkey to include a variable as a script name. That's not possible, but it makes sense in this case. The "FileInstall" commands can't be in the Template file because the Template doesn't know what the names of the files are to install (and if I made each per-install config edit the Template, then it's not a Template, is it?) So I basically ended out appending to the per-install config files with a ton of labels like "InstallFile1", "InstallFile2", and so on. It's not too big of a deal, it just makes the per-install config files a little more junked up.

So yeah, it's coming along well. Here's what I see I still need to do:
  •  BestInstaller:
    • Figure out an elegant way to set the Program and Readme.
    • Actually be able to WRITE all the variables to a file.
    • Read from an existing config ("Open")
    • Compile! (Possibly using a slightly modified AHK...for the icon)
    • Try to fix the license background (it's currently gray, I'd like it to be white; I might just replace the current control with an HTML control)
    • Try to fix the hidden Donate controls from vanishing when you switch tabs
  • Template:
    • Add file association
    • Give the welcome screen a makeover
    • Edit which file the script detects as the program
  • per-install ahk:
    • Edit the labels that install the files, since my ideas for how the config would save the file list has changed.

 I already mentioned it, but I threw in some hidden controls, for kicks. Like I said, an installer can optionally have a "Donate!" button at the very end of the install which can be used to send the user to a Paypal URL or some such. But in the config, when you enable "Donation option" on the last tab, it shows a little donation button of my own, plus a little message about why they should donate to me. But the funnest part for me is that I made the button enormous, for kicks, and it picks a random word to stick in the space of "BIG DONATE BUTTON OF ______". I have about 40 words so far from one brainstorming session, and they range from all out seriousness about why I need money ("COLLEGE TUITION") to references of things I like ("MAXIMUM RIDICULOSITY") to just plain silliness ("DOOM"). I'm hoping the silliness of the button makes the user forgive me a little for so blatantly asking them for money.

Anyway, I'm really, REALLY hoping to release BestInstaller in the coming weeks. It's definitely the cleanest program I've written so far, but even so, after I finish the things I mentioned about, I'll need to give the code a scrubdown, but then it should be good. I might take a breather, since -like I said- I wrote it basically in two sittings and it usually helps me get new ideas if I spend a little while away from the code. But anyway, thought I'd give you a heads up.

PS - I would include a screenshot, but an installer has so many pages it wouldn't do any good.....and the front welcome page of the installer so far is hideous.


PS - Wait, the post-script is supposed to after I sign my name, right? gah.

No comments:

Post a Comment