Old 1st March 2009, 14:39   #1
Candu
Junior Member
 
Join Date: Feb 2009
Location: Germany
Posts: 5
MojoPack NSIS plugin project written in Delphi

Hello,

I am using NSIS now for nearly 1,5 years. NSIS is the installer technology of my choice. So I decide to write own plugins to enhance the functionality of NSIS. Like a convinced Delphi programmer, the goal for me was to write NSIS plugins in Delphi. To give the NSIS community some more information about writing NSIS plugins using Delphi, I decide to provide the source code as well. Now, writing NSIS plugins should be very easy, because I have spent a lot of time to comment my source code well. Feel free to use the source for your own plugin project or just help to enhance my MojoPack NSIS plugin project (MNPP).

MojoPack provides a view useful functions and should be enhanced with more functions in the near future. Currently the following functions are implemented:

- 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

See the MojoPack_Readme.txt for more information about the usage of each function and what you have to do if you decide to help enhancing MojoPack.

At least let me give you some useful information how to write plugin functions (procedures) in Delphi.
-------------------------------------------------------------------------------------------
- Always use NSIS.pas for the interface to NSIS
- Each exported dll procedure must call the INIT() function of NSIS.pas first.
- The return value must always be of type string
- Each call of PopString() will catch the next parameter of the function. Note: all parameters
are passed as strings.
- The last call of PushString() fills $0

MNPP is developed with BDS2006/CRS2007 but you should be able to open the .dpr file in previous versions of Delphi.

To compile the Mojopack make sure you have the Jedi Code Library installed.

Special thanks to Bernhard Mayer, Peter Windridge, Brett Dever and Rainer Budde. Great job guys.

Use UPX to shrink the size of the output dll file. Thanks to the upx developper team Markus Oberhumer, Laszlo Molnar and John Reiser.


I hope, you find the provided stuff useful.
Candu
Attached Files
File Type: zip mojopack.zip (94.7 KB, 339 views)
Candu is offline   Reply With Quote
Old 2nd March 2009, 14:18   #2
Candu
Junior Member
 
Join Date: Feb 2009
Location: Germany
Posts: 5
Hello again,

I have updated the MojoPack with two additional functions:

WReplaceInFile and WReplaceInFileEx.

The functions are working similar to ReplaceInfile and ReplaceInFileEx, but using unicode files.

The version of MojoPack.dll has been increased to 1.0.0.1.

See MojoPack_ReleaseNotes.txt for some more details on this release.

The attached file only contains the dll, the readme and the release notes. The source code could not be included because of the file size limitation.

@board admins: do I have the chance to upload the whole MojoPack project somewhere? (211 KB).

Regards
Candu
Attached Files
File Type: zip mojopack1.0.0.1.zip (192.3 KB, 285 views)
Candu is offline   Reply With Quote
Old 2nd March 2009, 15:02   #3
Candu
Junior Member
 
Join Date: Feb 2009
Location: Germany
Posts: 5
OK, attached you will find the Source code of version 1.0.0.1.

For Delphians:
--------------
To compile the project, you must have the Jedi Code Library and the TMS Unicode Component Pack installed.


Regards
Candu
Attached Files
File Type: zip mojopack1.0.0.1_source.zip (36.9 KB, 303 views)
Candu is offline   Reply With Quote
Old 2nd March 2009, 20:39   #4
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Quote:
do I have the chance to upload the whole MojoPack project somewhere? (211 KB).
NSIS wiki http://nsis.sf.net is the place.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 1st September 2009, 15:34   #5
f!o
Junior Member
 
Join Date: Oct 2007
Posts: 2
Hello,

Your plugin unfortunately cannot work with the Unicode version of NSIS. I have the same issue.

Do you know if there is an existing version of the NSIS.pas that manages unicode for the string parameters passed ?

Thanks & Regards,
F!o
f!o is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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