Archive: Help on making an installer


Help on making an installer
Hello,

I posted a week or so ago some inquisitions into what I can do with NSIS, but I didn't know the extent of what I need to do, but now I do and I would like to know if anyone know if NSIS is the best way to do it, and can offer me some advice on how to create my installer and uninstaller.

I need to make an installer that will install my game correctly, which is the easy bit. The uninstaller needs to delete everything, which is again pretty simple. But the complexity of my situation is that program is going to have periodic updates and add-ons made for it, all of which will need to be stored into the current game install, and the uninstaller must be able to allow the user to delete different ad-ons as they wish, without deleting any files that may stop the program functioning. i.e. the ad-ons will contain code that already exists within the working game so that the add-on itself is a working unit, but the subsequent uninstall of that add-on must only delete the files that are not used by the rest of the program. An example to highlight what I am trying to say is this; add-ons are likely to be new levels for the program (which is a game), these levels will use common components that all levels of the game use (and hence are part of the main install) and will also be part of the add-on (so that it is a functioning unit in itself). When the add-on is installed these components that already exist from the main install can either be overwritten or not, but when the add-on is uninstalled they must not be deleted or the game will no longer work.

The current idea is to attach GUID's to files on install and log what GUID's belong to what installs, and segragate them accordingly, but I am clueless as to how to do this using NSIS. Does anyone know how to do this kind of thing, or if it is possible in NSIS (or anyother installer software), or am I going to have to create an installer/uninstaller from scratch? If anyone has had to do this kind of thing before I would really appreciate some tips and advice as to how to do it!

Thanks in advance,

Hayden Devlin


I have written updating software in NSIS. The way I would go about this is to have an INI file containing a list of updates and their corresponding files. The INI entries would have to be created at run time after the update download has completed. What you could do (what I did) is to extract the update to a temporary folder first and loop through the extracted files to see which of them already exists. If not, then add that file to the INI file for deletion.

You can use the INI file to build a list of add-ons to uninstall then also. You could use the EmbeddedLists plugin to do this.

The only complication I found with this system is if a file is shared by two or more add-ons as you have pointed out. The first add-on to install this file will have it marked for deletion because it did not already exist. However, the second file will not mark it for deletion because it was already installed and therefore assumes it is part of the game. Now, what happens when the user uninstalles the first add-on... the second add-on will cease to function correctly. My solution was for each file to be uninstalled, they'd be looked for in other add-on INI entries first (like a dependency check).

Hope that helps.

Stu


Did you do all that from NSIS or did you use a programming language like C++ to do the file reading and writing and import it like a plugin or something?

Cheers,

Hayden Devlin