Old 28th January 2006, 14:29   #1
l_d_allan
Member
 
l_d_allan's Avatar
 
Join Date: Jun 2005
Location: Colorado Springs, CO
Posts: 94
Can DetailPrint be used within .onInit?

Can the DetailPrint function be used within .onInit?

It seems only available after .onInit ... or I am doing something wrong or leaving something out???

Test script below that attemts to use DetailPrint .... which works during Section

; DetailPrintTest.nsi based on example1.nsi
Name "DetailPrintTest"
OutFile "DetailPrintTest.exe"
InstallDir $PROGRAMFILES\Test

ShowInstDetails show
;--------------------------------
; Pages
Page directory
Page instfiles
;--------------------------------
Section Anonymous ;No components page, name is not important
SetOutPath $INSTDIR
File DetailPrintTest.nsi
DetailPrint "Reached anonymous section"
SectionEnd ; end the section
;--------------------------------
Function .onInit
MessageBox MB_OK "Reached .onInit $\r$\n \
SMPROGRAMS: $SMPROGRAMS $\r$\n \
InstallDirectory: $INSTDIR "
DetailPrint "Reached .onInit"
DetailPrint "Install Dir: $INSTDIR"
DetailPrint "Sm Programs: $SMPROGRAMS"
FunctionEnd
;--------------------------------
Function .onGUIInit
MessageBox MB_OK "Reached .onGUIInit $\r$\n \
SMPROGRAMS: $SMPROGRAMS $\r$\n \
InstallDirectory: $INSTDIR "
DetailPrint "Reached .onGUIINit section"
FunctionEnd
l_d_allan is offline   Reply With Quote
Old 28th January 2006, 15:27   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
DetailPrint prints to the install log window. That window is only available when the instfiles page is reached. Sections are executed when the instfiles page shows, and that's why you see DetailPrints used in sections.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 28th January 2006, 18:39   #3
l_d_allan
Member
 
l_d_allan's Avatar
 
Join Date: Jun 2005
Location: Colorado Springs, CO
Posts: 94
Thanks for the info.

The underlying question is how to do debugging. I've used MessageBox, and sometimes DetailPrint can be used.

What other debugging capabilities does nsis make available?

Do any of the ide's provide something closer to "step-into" and "step-over" capability? Is there a way to "watch" the value of a variable?
l_d_allan is offline   Reply With Quote
Old 28th January 2006, 21:57   #4
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
There's a couple plugins you could use for debugging:

http://nsis.sourceforge.net/Nsisdbg_plug-in

http://nsis.sourceforge.net/DumpState_plug-in
Comperio is offline   Reply With Quote
Old 21st July 2011, 15:45   #5
isawen
Junior Member
 
Join Date: Jan 2010
Posts: 39
Does anyone have the plugin somewhere?
It seems that the link on the http://nsis.sourceforge.net/Nsisdbg_plug-in is valid but the there is a problem on the serve side or the file was removed.

Thanks in advance,
Isawen

isawen 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