Well, I think you have two very good solutions here: (C and D)
1) Swap the labels and the functions. I found the default labels and I think that we can use them, so i18n is not an issue, nor is hacking. 2) Set variables in both functions and in .onInstSuccess do the work as requested.
The second seems cleaner.

Are you describing a "hybrid C'D' "? Both the "Run" function and the "ShowMe" function would set independent flags, and then .onInstSuccess would first check about the ShowMeFlag, and then check whether to ExecWait InstallManager and then Exec sword.exe.

If so, seems reasonable .... then you don't have to change/swap the FINISHPAGE labels, which has a minor element of being unclear. It seems a little unexpected that the ShowReadMe would happen first (since it is below on the FINISHPAGE), but not unacceptable.

Or would you also swap the order of the functions by using swapped labels?

BTW, I got confirmation from the nsis forum that .onGUIEnd can be freely used in the MUI, unlike the .onGUIInit standard function. But that seems moot.

; Option C'D':

;******* Option C'D' ***************************

 !define MUI_FINISHPAGE_RUN_TEXT  "Run InstallManager and then sword.exe"
 !define MUI_FINISHPAGE_RUN
 !define MUI_FINISHPAGE_RUN_FUNCTION SetRunExecutableFlag
 !define MUI_FINISHPAGE_SHOWREADME_TEXT "Show InstallManager info"
 !define MUI_FINISHPAGE_SHOWREADME
 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowInstallManagerInfo
!insertmacro MUI_PAGE_FINISH

Var RunExecutablesFlag
Var ShowReadmeFlag

Function .onInit
 StrCpy $RunExecutablesFlag 0
 StrCpy $ShowReadmeFlag 0
FunctionEnd

Function SetRunExecutableFlag
 StrCpy $RunExecutablesFlag 1
FunctionEnd

Function ShowInstallManagerInfo
 StrCpy $ShowReadmeFlag 1
FunctionEnd

Function .onInstSuccess
 StrCmp $ShowReadmeFlag 1 0 CheckIfRunExecutables
   ExecWait 'notepad $INSTDIR\readme.txt'

 CheckIfRunExecutables:
 StrCmp $RunExecutablesFlag 1 0 PastRunningExecutables
   MessageBox MB_OK 'InstallManager would run here as ExecWait'
   MessageBox MB_OK 'sword.exe would run here as Exec after InstallManager'
 PastRunningExecutables:
FunctionEnd
;******* Option C ***************************


_______________________________________________
sword-devel mailing list: [email protected]
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

Reply via email to