Archive: Component Manager


Component Manager
I have created a new way to automatically handle repair, adding/removing components, and removal (uninstall) through dynamic script generation. I call it Component Manager, and I have already released the first beta.

Component Manager (CM for short :P ) replaces the Section, SectionEnd, File, CopyFiles, and SetOutPath commands in NSIS with its own modifications, allowing for a list of files, directories, componens, and (soon) shortcuts to be created without using an MSI-style database system. CM is kind of big (180-200KB for the runtime incl. the ExperienceUI) but it makes larger programs with a lot of optional components (like Winamp) easy to repair, modify, and remove, plus the installer is much more efficient. If you've used Winamp recently, you'll notice that it deletes ALL AVS scenes, MilkDrop scenes, etc. when you uninstall it. It leaves plugins and skins (last I checked) but not much else. With CM, a list of files is created while the script is compiled, meaning that each file is logged, but at compile time, and that means only, like, 2 lines of code for each file instead of a huge database in the Registry.

CM's only in beta, so it might (and probably does) have bugs. One bug in particular is it works great with the ExperienceUI, somewhat with the Modern UI, and hardly at all with the UltraModern UI. I haven't tried it with the InstallSpider UI yet.

Behind the scenes, is uses <Program Files>\Common Files\NSIS Installation Data\ComponentDatabase.ini to keep track of which components are installed. You can't change this filename yet, but I want to make it possible to write to either an INI or a registry key.

Links:
Wiki Page
Website
Downloads
Support forum

-dandaman32


This looks very nice!
I'll try it some day if I ever need to create a big installer.

-Stu


Forgot to note in documentation:
${File} command does NOT take wildcards - will try to implement in the future.

-dandaman32


To implement wildcards with my Self-Extractor I had to use an external executable.

-Stu


I don't understand
I don't manage compiling the example based on your CM...is it normal ?


I'm not sure what you mean by "compiling the example based on my CM"...could you provide more details please?

-dandaman32


He can't compile the example based on your Component Manager. ;)


Originally posted by Afrow UK
To implement wildcards with my Self-Extractor I had to use an external executable.
How so? The NSIS 2.11 !tempfile, !appendfile, and !delfile commands would probably be best, but CM includes support for <=2.10 with an external file-writing utility. It's very limited (files must be under 8kb, and lines must be under 1kb) but it works.

He can't compile the example based on your Component Manager ;)
I see..."based on"? If you're getting compile errors, JCD29, what error are you getting? I tried installing CM on a fresh copy of NSIS, and it worked fine. I didn't put a check for this in the installer, but CM requires Windows XP or some files won't copy. If you really want to know, these files are:

<Program Files>\Windows NT\Accessories\Wordpad.exe
<Program Files>\Windows NT\Accessories\Mswrd6.wpc
<Program Files>\Windows NT\Accessories\Mswrd8.wpc
<Program Files>\Windows NT\Accessories\write.wpc
<Windows>\Notepad.exe

All of these files go to <NSIS>\Examples\ComponentManager\Data.

If you aren't using Windows XP (or maybe Win2000) these files will be in <Program Files>\Accessories - I think, it's been a year and a half since I upgraded to Windows XP from Windows ME.

I copy them around your machine because they're too big to include in the installer, plus I don't want to help pirate Windows components.

-dandaman32