Archive: Skip Pages


Skip Pages
Hi,

i write the install path in the registry if a user installs my software. Now if a newer version of my software is available he user should not choose the install-directory if he updates his version.

To do this I must decide if the MUI_PAGE_DIRECTORY should be shown or not. I tried it in the configuration with a seperate function but calling seperate functions isn´t allowed in the configuration. I don´t know how to do this. In pseudo code it must be something like this.

---------------
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "license.txt"

if doupdate_check then
$INSTDIR = readregstr foo
else
!insertmacro MUI_PAGE_DIRECTORY

!insertmacro MUI_PAGE_FINISH
----------------

Does anybody know how to do this?

Best Regards

Rainer


if doupdate_check then
$INSTDIR = readregstr foo
else
!insertmacro MUI_PAGE_DIRECTORY
!define doupdate_check if you want to enable changing $INSTDIR:


!if doupdate_check
InstallDirRegKey "root_key" "subkey" "key_name"
!else
!insertmacro MUI_PAGE_DIRECTORY
!endif


If you already used InstallDirRegKey you can put it inside !else part.

Hi,

thanks for your answer. !if and so on are compile time commands but I think I need it at runtime. The decision to show the "!insertmacro MUI_PAGE_DIRECTORY" is by an registry entry on the enduser machine. "docheckupdate" must be a function and not a compiler flag. So is it the right way to do this?

Best Regards

Rainer


Oh, I thought that was compile time... So try this one (try to give more necessary details here):


!insertmacro MUI_PAGE_DIRECTORY

MUI_PAGE_CUSTOMFUNCTION_PRE DirectoryPre

Function DirectoryPre

ReadRegStr $0 "root_key" "subkey" "key_name"

# How do I call docheckupdate?
; Guessing:
;
; Supose the Input is the version in the registry.
; And Output is 2 for NEW, 1 for SAME, 0 for OLD.

Push $0
Call docheckupdate
Pop $0

# If it is NEW, skip the page

StrCmp $0 2 0 +2
Abort

FunctionEnd

Hi,

thanks for your answer again. I tried this but the "Abort" isn´t correct because the other installer pages where skipped. I don´t want abort the installation if the installer detects and older version. I only want to skip the "!insertmacro MUI_PAGE_DIRECTORY" command if an older version exits. If an older version exists i get the installpath from the registry so i don´t need the "!insertmacro MUI_PAGE_DIRECTORY". if no version exists the ""!insertmacro MUI_PAGE_DIRECTORY" should be executed.

I hope you understand me ;)

Best regards

Rainer


; define pre function
!define MUI_PAGE_CUSTOMFUNCTION_PRE skipCondition
; insert page
!insertmacro MUI_PAGE_DIRECTORY


; show or not to show function
Function skipCondition
; if don't want show page call Abort
EndFunction

Tomas


Hi,

ok that works. I don´t know why it doesn´t work on lunch but know it works.

Thx

Best Regards