Nxs plug-in: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Using <attach> tag instead of external download link, and rearranged the page a little bit.)
Line 3: Line 3:
== Links ==
== Links ==


[http://nsis.sourceforge.net/mediawiki/images/e/e6/Nxs.zip Download]
Download:<br>
<attach>Nxs.zip</attach>
 
[http://forums.winamp.com/showthread.php?threadid=211870 Forum thread]
[http://forums.winamp.com/showthread.php?threadid=211870 Forum thread]


Line 12: Line 14:
== Command line (NSIS script) ==
== Command line (NSIS script) ==


:Plug-in entry points: Show, Update, Destroy, HasUserAborted, getWindow
Plug-in entry points: Show, Update, Destroy, HasUserAborted, getWindow
 
=== Show DLL Function ===


  nxs::Show /NOUNLOAD "Dialog caption text" [/top "Top text"] [/sub "Sub text (more info)"] [/h 1] [/pos 43] [/max 100] [/can 1] [/end]
  nxs::Show /NOUNLOAD "Dialog caption text" [/top "Top text"] [/sub "Sub text (more info)"] [/h 1] [/pos 43] [/max 100] [/can 1] [/end]
Line 37: Line 41:
: Stops stack reading. If not used, plug-in reads stack 'till the bottom' and uses last found string as the caption.
: Stops stack reading. If not used, plug-in reads stack 'till the bottom' and uses last found string as the caption.


=== Update DLL Function ===


  nxs::Update /NOUNLOAD [... any of CHANGED Show parameters ...]
  nxs::Update /NOUNLOAD [... any of CHANGED Show parameters ...]


: Updates banner, supports any of Show parameters, but in most cases it is simpler - changed parameters only.
Updates banner, supports any of Show parameters, but in most cases it is simpler - changed parameters only.


=== getWindow DLL Function ===


  nxs::getWindow /NOUNLOAD
  nxs::getWindow /NOUNLOAD


: Returnes banner (dialog) window handle (HWND) use: Pop $0 ; $0 receives the handle. You don't need this in most cases :)
Returnes banner (dialog) window handle (HWND) use: Pop $0 ; $0 receives the handle. You don't need this in most cases :)


=== HasUserAborted DLL Function ===


  nxs::HasUserAborted /NOUNLOAD
  nxs::HasUserAborted /NOUNLOAD


: Checks if the Cancel button has been pressed, use: Pop $R0 ; $R0 value is "1" if user clicked Cancel or "0" (zero) otherwise.
Checks if the Cancel button has been pressed, use: Pop $R0 ; $R0 value is "1" if user clicked Cancel or "0" (zero) otherwise.


=== Destroy DLL Function ===


  nxs::Destroy
  nxs::Destroy


: Destroys the dialog.
Destroys the dialog.




Line 62: Line 70:
Package includes few nsi scripts.
Package includes few nsi scripts.
<highlight-nsis>
<highlight-nsis>
nxs::Show /NOUNLOAD `$(^Name) Setup` /top `Setup installing something$\r$\nPlease wait...` /sub `$\r$\n$\r$\n Preparing...` /h 0 /pos 0 /can 1 /end
nxs::Show /NOUNLOAD `$(^Name) Setup` /top \
        ; Add you initialization code here
                    `Setup installing something$\r$\nPlease wait...` \
nxs::Update /NOUNLOAD /sub "$\r$\n$\r$\n 50% complite" /pos 50 /end
                    /sub `$\r$\n$\r$\n Preparing...` /h 0 /pos 0 \
        ; Add more code here
                    /can 1 /end
nxs::Destroy
; Add you initialization code here
nxs::Update /NOUNLOAD /sub "$\r$\n$\r$\n 50% complite" /pos 50 /end
; Add more code here
nxs::Destroy
</highlight-nsis>
</highlight-nsis>



Revision as of 12:38, 30 June 2005

Author: Takhir (talk, contrib)


Links

Download:
Nxs.zip (33 KB)

Forum thread

Description

nxs.dll is NSIS plug-in, displaying banner with progress bar and Cancel button. Finally this is re-worked saivert' "NxS MSI LoaderDlg" plug-in with better stability.

Command line (NSIS script)

Plug-in entry points: Show, Update, Destroy, HasUserAborted, getWindow

Show DLL Function

nxs::Show /NOUNLOAD "Dialog caption text" [/top "Top text"] [/sub "Sub text (more info)"] [/h 1] [/pos 43] [/max 100] [/can 1] [/end]
/top
Sets the top text (to the right of the icon), 3 lines max.
/sub
Sets the subtext (above the progress bar control), 3 lines max.
/h
Shows/hides taskbar' dialog button. Requires a number: 1 means hide. 0 means show.
/pos
Sets the progress bar position. From 0 to 100 or /max value.
/max
Sets the number of steps the progress bar control has. Default value is 100.
/can
Enables/disables Cancel button on dialog. Requires a number: 1 = enable, 0 = disable. Default is disabled.
/end
Stops stack reading. If not used, plug-in reads stack 'till the bottom' and uses last found string as the caption.

Update DLL Function

nxs::Update /NOUNLOAD [... any of CHANGED Show parameters ...]

Updates banner, supports any of Show parameters, but in most cases it is simpler - changed parameters only.

getWindow DLL Function

nxs::getWindow /NOUNLOAD

Returnes banner (dialog) window handle (HWND) use: Pop $0 ; $0 receives the handle. You don't need this in most cases :)

HasUserAborted DLL Function

nxs::HasUserAborted /NOUNLOAD

Checks if the Cancel button has been pressed, use: Pop $R0 ; $R0 value is "1" if user clicked Cancel or "0" (zero) otherwise.

Destroy DLL Function

nxs::Destroy

Destroys the dialog.


Examples

Package includes few nsi scripts.

nxs::Show /NOUNLOAD `$(^Name) Setup` /top \
                    `Setup installing something$\r$\nPlease wait...` \
                     /sub `$\r$\n$\r$\n Preparing...` /h 0 /pos 0 \
                     /can 1 /end
; Add you initialization code here
nxs::Update /NOUNLOAD /sub "$\r$\n$\r$\n 50% complite" /pos 50 /end
; Add more code here
nxs::Destroy

Credits

Many thanks to coauthors: saivert - base code. Instructor - idea to fix base code bugs :) ; all tests and included samples.