MojoPack Library 1.0.0.0 for NSIS installer project
---------------------------------------------------
MojoPack.dll is written in Delphi.

NSIS is one of the best free installer technologies.

**************************************************************************************
Note:
-----
MojoPack will be extended with useful functionality in the near future. Feel free
to help improving the MojoPack project. Write your own functionality and let me know.
Release management should be up to me. Please use always a separate Unit for your 
enhancements and functionalities.

Important note:
---------------
The functionality of MojoPack.dll is provided as is.
Use it at your own risk.
**************************************************************************************


**************************************************************************************
Installation:
-------------
Simply copy the file MojoPack.dll to the NSIS Plugin directory. The Plugin directory can
usually be found under %PROGRAMFILES\NSIS\PLUGINS


MojoPack Update Instructions (especially for EclipseNSIS Intellisense):
-----------------------------------------------------------------------
If Eclipse is running, close Eclipse.
Delete MojoPack.dll in NSIS Plugin directory.
Start Eclipse.
Copy the new MojoPack.dll to the NSIS Plugin directory.
Enjoy EclipseNSIS Intellisense.

***************************************************************************************


MojoPack.dll Functions:
-----------------------
- SetAttributes:    Set file system attributes to entire directories
- ReplaceInFile:    Replace a string with another string in a given file 
- ReplaceInFileEx:  Replace two strings at the same time in a given file
- TerminateTask:    Terminate a running application
- CheckTask:        Check if task is currently running
- IsUserLocalAdmin: Check if current user is a member of the local administrator group

Note:
-----
Do not forget to set all parameters in each function you use. Otherwise, you will get an error.


Usage of SetAttributes:
-----------------------
PUSH $0
PUSH $1
MojoPack::SetAttributes <param1> <param2> <param3> <param4> <param5> <param6>
POP $0   # Result, 0 = ok, 1 = Error
POP $1	 # Extended Result can be one of the following three possibilities: 
	   - missing parameter
	   - exception occurs
	   - all fine

Parameter:
----------
<param1>:   root directory, enter the root directory without trailing backslash
<param2>:   file Mask, can be *.* or something similar
<param3>:   Recurse Flag, can be 0 or 1
<param4>:   Affect_RootFolderName Flag, can be 0 or 1
<param5>:   Affect_SubFolderName Flag, can be 0 or 1
<param6>:   Attributes Flag, can be 0,1,2,3,4,5,6,7 or 8

Attribute Possibilities of <param6>:
-------------------------------------------
     1:   Archive 
     2:   ReadOnly 
     3:   Archive  + ReadOnly
     4:   Hidden 
     5:   Archive  + Hidden
     6:   ReadOnly + Hidden
     7:   Archive  + ReadOnly + Hidden
     8:   Normal 

Important note:
---------------
All parameters must be set!


Example 1:
----------
MojoPack::SetAttributes "d:\temp" "*.*" 1 1 1 5

All files and all subdirectories within directory d:\temp will be modified with file attributes
archive and hidden. Furthermore, the root directory will also be affected.

Example 2:
----------
MojoPack::SetAttributes "d:\temp" "*.*" 1 0 0 6

All files in directory d:\temp and all files within all subdirectories will be modified with file
attributes readonly and hidden. The root directory name and the subdirectory names itself will
not be affected.


Usage of ReplaceInFile:
-----------------------
PUSH $0
PUSH $1
MojoPack::ReplaceInFile <param1> <param2> <param3>
POP $0   # Result, 0 = ok, 1 = Error
POP $1	 # Extended Result can be one of the following three possibilities: 
	   - missing parameter
	   - exception occurs
	   - all fine

Parameter:
----------
<param1>:   Input file name
<param2>:   string which will be replaced in the input file
<param3>:   string for replacement (of <param2>)

Example:
----------
MojoPack::ReplaceInFile "c:\foo.txt" "Replace" "with me"

All occurence of "Replace" (without quotes!) will be replaced with "with me" (also without quotes!).
Note, that the function is not case sensitive and do not work with Unicode files. 

    
Usage of ReplaceInFile:
-----------------------
PUSH $0
PUSH $1
MojoPack::ReplaceInFileEx <param1> <param2> <param3> <param4> <param5>
POP $0   # Result, 0 = ok, 1 = Error
POP $1	 # Extended Result can be one of the following three possibilities: 
	   - missing parameter
	   - exception occurs
	   - all fine

Parameter:
----------
<param1>:   Input file name
<param2>:   string1 which will be replaced in the input file
<param3>:   string1 for replacement (of <param2>)
<param4>:   string2 which will be replaced in the input file
<param5>:   string2 for replacement (of <param4>)


Example:
----------
MojoPack::ReplaceInFile "c:\foo.txt" "Replace" "with me" "do it" "also for me"

All occurence of "Replace" (without quotes!) will be replaced with "with me" (also without quotes!) and
all occurence of "do it" (without quotes!) will be replaced with "also for me" (also without quotes!).
Note, that the function is not case sensitive and do not work with Unicode files.

    
Usage of TerminateTask:
-----------------------
MojoPack::TerminateTask "FileName"

Example:
--------
PUSH $0
PUSH $1
MojoPack::TerminateTask "notepad.exe"
POP $0   # Return value (1 = success, 0 = no success)
POP $1	 # Extended Result can be one of the following three possibilities: 
	   - missing parameter
	   - exception occurs
	   - all fine

You also have the possibility to enter the task name without the .exe suffix like

MojoPack::TerminateTask "notepad"


Usage of CheckTask:
-----------------------
MojoPack::CheckTask "FileName"

Example:
--------
PUSH $0
PUSH $1
MojoPack::CheckTask "notepad.exe"
POP $0   # Return value (1 = success, task is running, 0 = no success, task is not running)
POP $1	 # Extended Result can be one of the following three possibilities: 
	   - missing parameter
	   - exception occurs
	   - all fine

You also have the possibility to enter the task name without the .exe suffix like

MojoPack::CheckTask "notepad"


Usage of IsUserLocalAdmin:
--------------------------

Example:
--------
PUSH $0
MojoPack::IsUserLocalAdmin
POP $0   # Return value (1 = success -> user is member of local admin group, 0 = no success)

The function has no parameters.	   

***************************************************************************************


MojoPack.dll created by Knut Anders (knut.anders@arcor.de) is a NSIS plugin developed with
BDS2006 / CRS2007.

Special thanks to Bernhard Mayer, Peter Windridge and Rainer Budde.

MojoPack uses UPX to shrink the size of the output dll file. Thanks to have such a wonderful tool.

                       Ultimate Packer for eXecutables
                          Copyright (C) 1996 - 2008
                                    by
          Markus Oberhumer, Laszlo Molnar & John Reiser   Apr 27th 2008



  Important note:
  ---------------
  The functionality of MojoPack.dll is provided as is.
  Use it at your own risk.


I hope you enjoy MojoPack.

   Knut
