Archive: Relgotopage - understanding problem


Relgotopage - understanding problem
hi,
I'm having some problems with an installer again.

I'm writing an installer for a program that needs Word and Excel. I have one custam page with radio buttons to choose the Officeversion to use with the problem. Now I'm trying to add another custom page that's only called if excel.exe isn't found in the appropriate directory.
I tried RelGotoPage for that, but I can't realy puzzle out the documentation for that function. I used:


Function "Jump"
Iffileexists "$WORD_VERSIONEXCEL.EXE" 0 OfficeNV
StrCpy $R9 "2"
Call RelGotoPage
Abort
OfficeNV:
StrCpy $R9 "1"
Call RelGotoPage
Abort
FunctionEnd

but that didn't work at all, I allways got to the second custom page.

I think I should use something like this example:

!include "MUI.nsh" ;Required by MUI

Page custom CustomPage
!define MUI_PAGE_CUSTOMFUNCTION_PRE Components_PreFunction
!insertmacro MUI_PAGE_COMPONENTS
!define MUI_PAGE_CUSTOMFUNCTION_PRE Directory_PreFunction
!insertmacro MUI_PAGE_DIRECTORY

!define MUI_CUSTOMFUNCTION_ABORT "FunctionName"
!insertmacro MUI_LANGUAGE "English" ;Required by MUI

Function CustomPage
StrCpy $R8 1 ;This is the first page
InstallOptions::dialog "C:\MyDir\MyIOPage.ini"
Pop $0
FunctionEnd

Function Components_PreFunction
StrCpy $R8 2 ;This is the second page
FunctionEnd

Function Directory_PreFunction
StrCpy $R8 3 ;This is the third page
FunctionEnd

Function FunctionName
StrCmp $R8 1 0 End ;Compare the variable with the
;page index of your choice
StrCpy $R9 1
Call RelGotoPage
Abort
End:
FunctionEnd

but I just don't understand what all that means and how I should adapt it for my installer. I'd be quite grateful if someone could explain it to me a bit more detailed.

You should try and refrain from using RelGotoPage because when the user clicks the back button they will still be shown the page. Instead what you should do is call Abort in page's pre functions and custom page's show functions if a certain condition is set to skip them.

Stu


Ok, thanks, it's working now, and it's shorter too.:)