[sword-devel] BibleCS Installer: readme before executables

L.Allan-pbio paraclete at bibleinverse.org
Fri Feb 10 07:38:00 MST 2006

> 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 

; Option C'D':

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

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

Var RunExecutablesFlag
Var ShowReadmeFlag

Function .onInit
  StrCpy $RunExecutablesFlag 0
  StrCpy $ShowReadmeFlag 0

Function SetRunExecutableFlag
  StrCpy $RunExecutablesFlag 1

Function ShowInstallManagerInfo
  StrCpy $ShowReadmeFlag 1

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

  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'
;******* Option C ***************************

More information about the sword-devel mailing list