|
|
#1 |
|
Junior Member
Join Date: Jul 2007
Posts: 3
|
Functions for large CD/DVD installers
Hello all, I've been leeching here for a while, so I figured I'd make my first post a contribution.
I've made a couple functions which we use in our game's installer, and I think might be useful to many other people. I fully hope/expect that the more experienced NSIS users here will improve/clean up these rough functions. Here was our situation, or why I made the functions: ------ -Our game was ~4 gigs in size, distributed on DVD and/or multiple CDs. So I needed to be able to span the installer across multiple discs. -We can't pack it all into the NSIS installer because the data is too large. We have no need to compress all files anyway, since it makes the install take longer and we have extra room on the discs. -We send out different versions of our game to various customers, which all contain different content. We also have frequent updates/additions to our content. So I wanted an easy way to adjust exactly what content files are being included in a specific installer, to reduce human error. I also don't want to recompile a huge installer just to add/change the content if we make a change to one small file. -I wanted the progress bar to give a good estimate of the installer's progress. This is difficult due to the above problems, and the fact that the realProgress plugin can't use floating point numbers. -We ran into lots of trouble with files not being correctly copied off of the disc onto the hard drive (especially with CD installers). Sometimes the game wouldn't run after the install, due to corrupted files, even though the files on the disc were fine. ------ So I wrote these two functions. What they do is: -Copy or extract (7z archive) a file from the CD/DVD into the install directory. -Ensure the file was correctly copied / extracted, without errors. If it there were problems, it retries. If there are still problems after the retry, it aborts the install. -Increases the progress bar (requires RealProgress plugin) according to how much copy/extracting remains. (Example: you are copy/extracting a total of 100mb throughout your entire installer; you copy over 2.3 mb. Progressbar increases by 2%. You then extract a file that is 12.7mb uncompressed. Progress bar now increases by 13%.) Below are the functions, as well as (poorly written) instructions for use. They were written very quickly so they are very rough and ugly to use, please forgive me for that. I am going to try to improve/clean them up, unless someone else does so: code: Comments and improvements are very much welcome. I really would like to make it nicer to use. I'd especially like to add automatic file size detection, so you don't have to write that in when using the macros, and maybe so it automatically uses 'addsize' for that file. It also would be useful, at least for me, to have it just point at a directory on the disc, and then it automatically copies/extracts all the files in there. This way I wouldn't have to bother messing with file lists. |
|
|
|
|
|
#2 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
Interesting
![]() This kind of installer has been asked several times from several users. However would be nice if you post those functions at wiki where it's easy for everyone to find them. Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#3 | |
|
Junior Member
Join Date: Jul 2007
Posts: 3
|
Quote:
|
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|