Old 28th January 2005, 18:15   #1
Senior Member
Join Date: Sep 2004
Location: Los Angeles
Posts: 223
Unhappy MSIBanner Woes

I keep getting intermittent compile erors with the new version of MSIBanne
I changed the MSI nsi to the below to produce the error...sometimes it compiles...sometimes it doesn't

!define PRODUCT "MSIBanner"
OutFile ${PRODUCT}.exe
ShowInstDetails show
XPStyle on

Var bannerText
Var theFile
Var destDir
Var user
Var isAdmin
Var accountType

Function .onInit
strcpy $bannerText "I am having errors "
MSIBanner::Show /NOUNLOAD "NSIS Installer - $bannerText}"
call isAdmin
call first
;call second

function first

; Call MSIBanner Update function so, the text & the progress bar will be...mmm, updated
MSIBanner::Update /NOUNLOAD "${PRODUCT} is blash"
; Sleep a while, since we don't real reading let's see for a sec. the text

; Call update, to add more text, and the progress bar sould increase more:
MSIBanner::Update /NOUNLOAD "Reading unknown stuff from your PC"

Sleep 1000

; Update more...
MSIBanner::Update /NOUNLOAD "${PRODUCT} is blash bloop"
; more pretty text:
Sleep 1000


Function Second
; Let's reset the progress bar...
MSIBanner::Reset /NOUNLOAD "Reseting values..."
; Now.. we can add our values to move the progress bar as we wish
Sleep 1000
MSIBanner::Move /NOUNLOAD 20 "Countdown to ${PRODUCT} is blash"
Sleep 1000
MSIBanner::Move /NOUNLOAD 20 "Countdown to destruction 4"
Sleep 1000
MSIBanner::Move /NOUNLOAD 20 "Countdown to destruction 3"
Sleep 1000
MSIBanner::Move /NOUNLOAD 10 "Countdown to destruction 2"
Sleep 1000
MSIBanner::Move /NOUNLOAD 30 "Countdown to ${PRODUCT} is blash"
Sleep 1000
MSIBanner::Reset /NOUNLOAD "Re-counting again.... ${PRODUCT} is blash"
; And... let's move the progress bar manually
Sleep 1000
MSIBanner::Pos /NOUNLOAD 10 "Reading hardaware"
Sleep 1000
MSIBanner::Pos /NOUNLOAD 25 "Reading memory"
Sleep 1000
MSIBanner::Pos /NOUNLOAD 45 "Reading mouse"
Sleep 1000
MSIBanner::Pos /NOUNLOAD 60 "Reading software"
Sleep 1000
MSIBanner::Pos /NOUNLOAD 40 "wait... forgot keyboard"
Sleep 1500
MSIBanner::Pos /NOUNLOAD 70 "Reading CPU"
Sleep 1000
MSIBanner::Pos /NOUNLOAD 90 "Finishing global scoops..."
Sleep 1000
; last call and the progress bar will increase more:
MSIBanner::Pos /NOUNLOAD 100 "Cleaning...."
; look, more pretty text:
Sleep 1000


Function isAdmin
Call isUserAdmin
strcmp $R0 "true" isAdmin notAdmin
;messageBox MB_OK "we are admin"
;strcmp $QT "current" +1 done
;messageBox MB_OK "QT is current"
MSIBanner::Pos /NOUNLOAD 10 "We are admin"
sleep 1000
; Call firstInstall
;Call UpdateCheck
goto done
;strcmp $QT "current" +1 getAdmin
MSIBanner::Pos /NOUNLOAD 10 "We are NOT admin"
;call firstInstall
;Call UpdateCheck
goto done

;call getAdmin
;MessageBox MB_ICONSTOP "This application must be installed by an administrator.$\nClick 'OK' to terminate the installation."
;on to installation section

Function IsUserAdmin
Push $R0
Push $R1
Push $R2

IfErrors Win9x
Pop $R1
Pop $R2

StrCmp $R2 "Admin" 0 Continue
; Observation: I get here when running Win98SE. (Lilla)
; The functions UserInfo.dll looks for are there on Win98 too,
; but just don't work. So UserInfo.dll, knowing that admin isn't required
; on Win98, returns admin anyway. (per kichik)
; MessageBox MB_OK 'User "$R1" is in the Administrators group'
StrCpy $R0 "true"
Goto Done

; You should still check for an empty string because the functions
; UserInfo.dll looks for may not be present on Windows 95. (per kichik)
StrCmp $R2 "" Win9x
StrCpy $R0 "false"
;MessageBox MB_OK 'User "$R1" is in the "$R2" group'
Goto Done

; comment/message below is by UserInfo.nsi author:
; This one means you don't need to care about admin or
; not admin because Windows 9x doesn't either
;MessageBox MB_OK "Error! This DLL can't run under Windows 9x!"
StrCpy $R0 "true"

strcpy $user "$R1"
strcpy $isAdmin "$R0"
strcpy $accountType "$R2"
strcpy $bannerText "User= $R1, AccountType= $R2, IsUserAdmin= $R0"

MSIBanner::UPDATE /NOUNLOAD "$bannerText"
sleep 1000
Pop $R2
Pop $R1
Exch $R0



Section -default
; Destroy the banner here, where we have a valid HWND
; if the progress bar isn't full, this fuction will make it:
; Note:
; the minimum value is 0 and the maximum is 100.
; Everytime the function "Update" is called, the progress bar moves "5" units (global increment).
; Everytime the function "Move" is called, the progress bar adds the inputed value to the global increment.
; Everytime the function "Pos" is called, the progress bar moves into position inputed, becoming the current global increment.
DetailPrint "Works great!"
grahama is offline   Reply With Quote
Old 28th January 2005, 18:49   #2
Afrow UK
Afrow UK's Avatar
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
It would be better to post the compile errors rather than your source code.
Also, not that you need to now, but please attach your source code as a file attachment (so you don't get smilies and it is easier to read the topic).

Afrow UK is offline   Reply With Quote
Old 28th January 2005, 19:12   #3
Senior Member
Join Date: Sep 2004
Location: Los Angeles
Posts: 223
Good Idea...

here's the script....

where are the compiling errors stored ?
grahama is offline   Reply With Quote
Old 29th January 2005, 02:10   #4
Debian user
(Forum King)
Joel's Avatar
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
ok.... One think that I haven't tested with the plugin was multiple function calling...as you using....

Basically, as the example that I attached, the plugin is used in one function only.... not multiple....

Right know, can't test...I'm not at home...this weekend I'll work it

* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 29th January 2005, 06:40   #5
Major Dude
Comperio's Avatar
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
PS: According to the help files, you can call MakeNSIS.EXE with the switch '/o' followed by the filename to have the compiler output messages to a file instead of on screen.

You can also copy and paste the errors from the compiler interface (MakeNSISW.EXE)
Comperio is offline   Reply With Quote
Old 29th January 2005, 07:15   #6
Senior Member
Join Date: Sep 2004
Location: Los Angeles
Posts: 223
no worries Lobo
going to be taking the weekend off....
will take my g/f to the ocean and enjoy a couple days without a computer
have a great weekend
grahama is offline   Reply With Quote
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