[sword-devel] BibleCS Installer: readme before executables

DM Smith dmsmith555 at yahoo.com
Fri Feb 10 08:39:48 MST 2006

The implementation is not a hybrid of C&D but more a variation on C as 
you gave in code below.

If it is clearer to swap the labels, I would be glad to do that.

I've uploaded the changes to 
See SwordSetup.nsi and SwordFinish.nsh for the implementation.
Please note, it is a snapshot that compiles, but might not be correct.
I have not gotten to most of the problems that you have noted and may 
have introduced a few more.

For example, I am working on creating several headers and while they 
compile, they are not done.
Also I am moving to the HKCU/HKLM solution by calling SetShellContextVar 
all in .onInit and un.onInit.
I've also created a macro for the splash screen and am trying to 
generalize it.

Part of this is a preparation for something that Troy requested.
He would like to drop a directory named "windows" into the installer 
directory and have whatever is in that image be installed.
Of course there would be some expectations of the contents in that root 
directory, e.g. license, readme.txt, splash.bmp, executables, ... so 
that the pages that depend on those files work.

L.Allan-pbio wrote:
>> 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_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
> 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: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page

More information about the sword-devel mailing list