Archive: Checkbox to run program on finish and remembering language for uninstaller


Checkbox to run program on finish and remembering language for uninstaller
The help from this forum was excellent last time so I thouhgt I'd come back and ask for help with two little things. I want to place a checkbox on the final page that says "Run Globulation 2 now" or whatever I want (ie, must be easily editable and able to have language support). If the checkbox is ticked, it loads $INSTDIR\glob2.exe after clicking finish. I belive I'd have to make a custom page for this, which is even more annoying, cause how will that work with language files? Or is there a settings I can add before or onto

!insertmacro MUI_PAGE_FINISH

Something like:

!insertmacro MUI_PAGE_FINISH "Run Globulation 2 now" "$INSTDIR\glob2.exe"

perhaps?

And lastly, when installing, it ask for a language, so what I want, it for it to remember that value however it can, and automaticly use that language when uninstalling (instead of asking for it again).

Any help with these two things would be appreciated :D


There's no need for a custom page, simply use MUI_FINISHPAGE_RUN. See the Modern UI readme for more details about it.

To remember the language, use MUI_LANGDLL_REGISTRY_ROOT and friends. Again, see the MUI readme for more details.


I replaced:

!insertmacro MUI_PAGE_FINISH
with:
!insertmacro MUI_FINISHPAGE_RUN $INSTDIR\glob2.exe
and I get:
!insertmacro: MUI_FINISHPAGE_RUN
!insertmacro: macro named "MUI_FINISHPAGE_RUN" not found!
Error in script "C:\mingw\home\xxxxxxx\win32_installer.nsi" on line 41 -- aborting creation process
As for using the registery, I already am:
;------------------------------------
;Language Selection Dialog Settings
;------------------------------------
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\Globulation_2"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
;------------------------------------
;Languages
;------------------------------------
!insertmacro MUI_LANGUAGE "English"
yet it still promts for language when uninstalling instead of automaticly using enlgish.

Hmm, think you should read the Modern UI readme.

!define MUI_FINISHPAGE_RUN $INSTDIR\glob2.exe
!insertmacro MUI_PAGE_FINISH

-Stu


Lol. I must have skipped the part where is said that cause I see it now. /kicks self :D Thanks for that :D

Any idea whats wrong with the language thing?


All fixed. Had to move

;------------------------------------
;Language Selection Registery Key
;------------------------------------
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\Globulation_2"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
before the MUI_PAGE commands. Thanks for the help everyone :D