Old 28th September 2005, 09:10   #1
BeerBullet
Junior Member
 
Join Date: Sep 2005
Posts: 2
Question Skipping multiple pages - need help

Hi there...

I wrote a small Installer with a custom Page, where you can add a ODBC-Datasource. So far so nice...
The problem is, if the programm is already installed I want to skip the welcome, directory and my custom page. How can I do this?

Some Code:

!define MUI_PAGE_CUSTOMFUNCTION_PRE checkUpdate
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Select ODBC Page
Page custom SelectODBCPage LeaveSelectODBCPage
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
.
.
.
Function checkUpdate
ReadRegStr $appInstalled HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayName"
strcmp $appInstalled "" install
MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(ASK_UPDATE)" IDYES +2 IDNO 0
quit
install:
FunctionEnd

I already found the MUI_PAGE_CUSTOMFUNCTION_PRE macro, but how can I use this or something like that more than once?

THX NSIS gods!!
BeerBullet is offline   Reply With Quote
Old 28th September 2005, 09:23   #2
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
You could use that define for all the 3 pages, or you could use the function Go to a NSIS page. That one you just need to use once.

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 28th September 2005, 12:54   #3
BeerBullet
Junior Member
 
Join Date: Sep 2005
Posts: 2
thank you deguix

..the first hint did it. This "jump"-function didn't work for me..I dont know why. Anyway..I got a solution

Note:I have to call the "checkUpdate"-function in my Custom-Create-Function (SelectODBCPage) manually. Didn't work with !define MUI_PAGE_CUSTOMFUNCTION_PRE "checkUpdate"


Some code for copy and pasters:

Var appInstalled
Var doUpdate
.
.
.
!define MUI_PAGE_CUSTOMFUNCTION_PRE "checkUpdate"
; Welcome page
!insertmacro MUI_PAGE_WELCOME

!define MUI_PAGE_CUSTOMFUNCTION_PRE "checkUpdate"
; Directory page
!insertmacro MUI_PAGE_DIRECTORY

; Select ODBC Page
Page custom SelectODBCPage LeaveSelectODBCPage

; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
.
.
.
Function .onInit
strcpy $doUpdate false
.
.
.
FunctionEnd

Function checkUpdate
strcmp $doUpdate true skip
ReadRegStr $appInstalled HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayName"
strcmp $appInstalled "" install
MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(ASK_UPDATE)" IDYES update IDNO 0
quit
skip:
abort
update:
strcpy $doUpdate true
abort
install:
FunctionEnd
.
.
.
Function SelectODBCPage
call checkUpdate
.
.
.
FunctionEnd
BeerBullet 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