Speed78
24th May 2004 20:53 UTC
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
deguix
24th May 2004 22:07 UTC
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.
Speed78
25th May 2004 18:23 UTC
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
deguix
25th May 2004 22:36 UTC
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
Speed78
26th May 2004 13:26 UTC
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
tma
26th May 2004 19:44 UTC
; 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
Speed78
26th May 2004 21:21 UTC
Hi,
ok that works. I don´t know why it doesn´t work on lunch but know it works.
Thx
Best Regards