Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 24th May 2007, 00:23   #1
Gato Muerto
Junior Member
 
Gato Muerto's Avatar
 
Join Date: Nov 2004
Location: West Coast
Posts: 36
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.


Of course, if you have a different way, I just need to detect already installed files and avoid overwriting existing files.

Last edited by Gato Muerto; 24th May 2007 at 00:48.
Gato Muerto is offline   Reply With Quote
Old 24th May 2007, 01:08   #2
theblazingangel
Junior Member
 
Join Date: Mar 2006
Posts: 29
would it not be easier to use SetOverwrite off?
theblazingangel is offline   Reply With Quote
Old 24th May 2007, 01:35   #3
Gato Muerto
Junior Member
 
Gato Muerto's Avatar
 
Join Date: Nov 2004
Location: West Coast
Posts: 36
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 )). Overwriting is the least of the worries.
Gato Muerto is offline   Reply With Quote
Old 24th May 2007, 15:09   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
For 3, use NSISArray.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 24th May 2007, 17:26   #5
Gato Muerto
Junior Member
 
Gato Muerto's Avatar
 
Join Date: Nov 2004
Location: West Coast
Posts: 36
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?
Gato Muerto is offline   Reply With Quote
Old 25th May 2007, 15:57   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
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

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 29th May 2007, 17:01   #7
Gato Muerto
Junior Member
 
Gato Muerto's Avatar
 
Join Date: Nov 2004
Location: West Coast
Posts: 36
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.
Gato Muerto is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump