Advanced Uninstall Log NSIS Header: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
{{PageAuthor|Red Wine}}
{{PageAuthor|Red Wine}}


== Links ==
== Links ==
Line 18: Line 20:
files, nevertheless it has the disadvantage that such an installation should
files, nevertheless it has the disadvantage that such an installation should
be uninstalled with RmDir /r which is risky and removes also data that has
be uninstalled with RmDir /r which is risky and removes also data that has
been added/created later within the installation folder.<br>
been added/created later within the installation folder.




Line 27: Line 29:
is used by the uninstaller to uninstall files/directories that have been
is used by the uninstaller to uninstall files/directories that have been
added within specific installation blocks.<br>
added within specific installation blocks.<br>
<br>
 
This means that files which have been installed outside these blocks,
This means that files which have been installed outside these blocks,
or added later either by the user or application's activities, ignored
or added later either by the user or application's activities, ignored
by the uninstaller.<br>
by the uninstaller.<br>
<br>
 
Moreover files that might exist into the target directory prior the current
Moreover files that might exist into the target directory prior the current
installation, ignored as well.<br>
installation, ignored as well.<br>
<br>
 
Advanced Uninstall Log creates an uninstall log that removes only files that
Advanced Uninstall Log creates an uninstall log that removes only files that
have been installed and optionally interacts with users for every other file
have been installed and optionally interacts with users for every other file
and/or directory has found in installation folder and requires permission to
and/or directory has found in installation folder and requires permission to
remove these files/directories.<br>
remove these files/directories.<br>
<br>
 
It is enhanced as well to support updates, e.g. if the installer later would
It is enhanced as well to support updates, e.g. if the installer later would
update the installation by adding new data, the uninstaller would remove the
update the installation by adding new data, the uninstaller would remove the
Line 49: Line 51:
If target installation folder exists and contains files and/or directories
If target installation folder exists and contains files and/or directories
they all preserved from being uninstalled.<br>
they all preserved from being uninstalled.<br>
<br>
 
Uninstaller removes data that has been added within specific installation
Uninstaller removes data that has been added within specific installation
blocks, preserving all other data that has been created/added outside of
blocks, preserving all other data that has been created/added outside of
these installation blocks. See included examples for details.<br>
these installation blocks. See included examples for details.<br>
<br>
 
Supports unlimited updates/reinstallations.<br>
Supports unlimited updates/reinstallations.<br>
<br>
 
Supports two uninstaller modes. Interactive mode requires confirmation
Supports two uninstaller modes. Interactive mode requires confirmation
to remove every other file exept those files that have been installed.
to remove every other file exept those files that have been installed.
Unattended mode leaves intact every other file without bothering users.<br>
Unattended mode leaves intact every other file without bothering users.<br>
<br>
 
In case when uninstall log (uninstall.dat) has been removed manually instead
In case when uninstall log (uninstall.dat) has been removed manually instead
of execute uninstaller, if users attempt to run the installer later, a warning
of execute uninstaller, if users attempt to run the installer later, a warning
issued that they should select a new output folder.<br>
issued that they should select a new output folder.<br>
<br>
 
Implements only the included with NSIS release headers FileFunc and TextFunc.
Implements only the included with NSIS release headers FileFunc and TextFunc.
There is no need for external plugins and headers, adds a very small overhead.
There is no need for external plugins and headers, adds a very small overhead.
Line 71: Line 73:


If uninstall log (uninstall.dat) is missing uninstaller won't execute at all.<br>
If uninstall log (uninstall.dat) is missing uninstaller won't execute at all.<br>
<br>
 
Due to file create - write procedure that is required in order to add/update
Due to file create - write procedure that is required in order to add/update
the uninstall log (uninstall.dat), restricted users on NT based systems won't
the uninstall log (uninstall.dat), restricted users on NT based systems won't
be able to execute the installer.<br>
be able to execute the installer.




Line 85: Line 87:
and contains a large amount of data which will be excluded from uninstall log,
and contains a large amount of data which will be excluded from uninstall log,
or added large amount of data after the installation which will be excluded also,
or added large amount of data after the installation which will be excluded also,
the delay should be noticeable.<br>
the delay should be noticeable.




Line 95: Line 97:
Kichik dropped me a dozen of suggestions helping me to achieve my plan.
Kichik dropped me a dozen of suggestions helping me to achieve my plan.
However, his main suggestion to eliminate the mentioned above disadvantage,
However, his main suggestion to eliminate the mentioned above disadvantage,
still remains untouched by me.<br>
still remains untouched by me.





Revision as of 12:14, 4 February 2007

Author: Red Wine (talk, contrib)



Links

Download

Download Advanced Uninstall Log NSIS header including 2 complete examples of usage.

  • Main download link: Advunlog.zip (36 KB).
  • Mirror download link: Advulog.zip (36 KB).
    MD5: c586e6d4c707aae1737a4df67fa8e398
Discussion
  • Winamp Forums thread.
    This is the place to post your comments and suggestions. Also bugs reporting goes here.


Overview

Advanced Uninstall Log for NSIS was born in the need to cover a specific gap.
It's been discussed fairly enough that the File /r command is very useful in cases when developers want to add a huge amount of sub directories and files, nevertheless it has the disadvantage that such an installation should be uninstalled with RmDir /r which is risky and removes also data that has been added/created later within the installation folder.


About Advanced Uninstall Log

Advanced Uninstall Log is a macro system provided in a NSIS header that is able to monitor an installation and build an uninstall log file which is used by the uninstaller to uninstall files/directories that have been added within specific installation blocks.

This means that files which have been installed outside these blocks, or added later either by the user or application's activities, ignored by the uninstaller.

Moreover files that might exist into the target directory prior the current installation, ignored as well.

Advanced Uninstall Log creates an uninstall log that removes only files that have been installed and optionally interacts with users for every other file and/or directory has found in installation folder and requires permission to remove these files/directories.

It is enhanced as well to support updates, e.g. if the installer later would update the installation by adding new data, the uninstaller would remove the new data that has been added by the installer, without bothering users about.


Features

If target installation folder exists and contains files and/or directories they all preserved from being uninstalled.

Uninstaller removes data that has been added within specific installation blocks, preserving all other data that has been created/added outside of these installation blocks. See included examples for details.

Supports unlimited updates/reinstallations.

Supports two uninstaller modes. Interactive mode requires confirmation to remove every other file exept those files that have been installed. Unattended mode leaves intact every other file without bothering users.

In case when uninstall log (uninstall.dat) has been removed manually instead of execute uninstaller, if users attempt to run the installer later, a warning issued that they should select a new output folder.

Implements only the included with NSIS release headers FileFunc and TextFunc. There is no need for external plugins and headers, adds a very small overhead.


Restrictions

If uninstall log (uninstall.dat) is missing uninstaller won't execute at all.

Due to file create - write procedure that is required in order to add/update the uninstall log (uninstall.dat), restricted users on NT based systems won't be able to execute the installer.


Disadvantage

Since the header does not implement anything else than the common NSIS release, a delay occurs while builds and reads the uninstall log because it needs to throw the list several times. Talking for common cases, most likely the delay won't be noticeable, however, in cases where the target directory isn't empty and contains a large amount of data which will be excluded from uninstall log, or added large amount of data after the installation which will be excluded also, the delay should be noticeable.


Credits

A very big thanks goes to kichik NSIS developer.
When my idea of the Advanced Uninstall Log became an NSIS header, it was indeed an amateur's attempt to write a flexible and errors free NSIS header. Kichik dropped me a dozen of suggestions helping me to achieve my plan. However, his main suggestion to eliminate the mentioned above disadvantage, still remains untouched by me.


License

This header file is provided 'as-is', without any express or implied warranty.
In no event will the author be held liable for any damages arising from the use of this header file.

Permission is granted to anyone to use this header file for any purpose, including commercial applications,
and to alter it and redistribute it freely, subject to the following restrictions:

  • The origin of this header file must not be misrepresented; you must not claim that you wrote the original header file.
  • If you use this header file in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  • Altered versions must be plainly marked as such, and must not be misrepresented as being the original header file.
  • This notice may not be removed or altered from any distribution.