Gato Muerto
24th May 2007 01:23 UTC
How to change installer based on user's existing files?
As the title states, I am trying to change installer options based on if files are already installed. I am attempting the following:
1. Read a list of files to be installed to location. This could be within the original .nsi script itself, but might make it difficult for #3.
2. Retrieve list of files that are already installed to the location by the program. (Add/Remove functionality)
3. Detect what files that are not on list 2 but are on list 1 that are already installed.
4. Show the MUI_PAGE_COMPONENTS page with files on list 3 either a)Not showing as install options or b)Permanently marked to avoid overwriting/erasing the files needed by another program.
I can see how to do 1 and 2, but having difficulties with 3 and 4. I tried using PUSH commands, but there appears to be an upper limit on how many times I can use that in a row... or at least the compiled installer does odd things after the 4-5 POP command I use.
:igor:
Of course, if you have a different way, I just need to detect already installed files and avoid overwriting existing files.
theblazingangel
24th May 2007 02:08 UTC
would it not be easier to use SetOverwrite off?
Gato Muerto
24th May 2007 02:35 UTC
The add/remove portion would remove the files if there is no way to selectively disable them (and the user is unaware (always good to assume :D )). Overwriting is the least of the worries.
Afrow UK
24th May 2007 16:09 UTC
For 3, use NSISArray.
Stu
Gato Muerto
24th May 2007 18:26 UTC
Ooooo. Spiffy. Never seen the array function before, so happily playing with the features. Boss is leaning on me to get results, so working under time constraints.
Is it possible to make NSIS refer to an external dynamic ini file when ON the components page in order to display (or mark as mandatory) specific files for installation, or must it be defined upon compile?
Afrow UK
25th May 2007 16:57 UTC
You can add lots of sections with no captions to hide them and unselected (/o), then enable the first X depending on the INI file and set the captions (to show them) with SectionSetText.
Stu
Gato Muerto
29th May 2007 18:01 UTC
Thanks. The boss decided to scrap the idea since it was taking too long, but I think I am going to try this idea to make a stand-alone font installer/uninstaller.