Archive: UninstallCaption problem


UninstallCaption problem
Var myCaption
(1)UninstallCaption "Application unintaller"
(2)UninstallCaption "$myCaption"

Function un.onInit
StrCpy $myCaption "Application unintaller"
MessageBox MB_ICONQUESTION|MB_YESNO "some words" IDYES +2
Abort
....
FunctionEnd

If I use way(1),the caption of MessageBox is "Application unintaller".

but if I use way(2),MessageBox has no caption.

What's the reason?

Thanks very much!


When you change the value of $myCaption in the function it does not change the value in the caption as the function is not ended yet. if you check in a section aftes the initalisation of the uninstaller you can see that the caption has changed


Function un.onInit
StrCpy $myCaption "Application unintaller"
MessageBox MB_ICONQUESTION|MB_YESNO "some words" IDYES +2
Abort
FunctionEnd

Caption "$myCaption" ;if on top then the uninstaller will crash

Section
MessageBox MB_ICONQUESTION|MB_YESNO "some words" IDYES +2
SectionEnd


Re: UninstallCaption problem
Hi there!


The caption is initialised at runtime. You have to set the caption by other means.

Have a look at this wiki article:

http://nsis.sourceforge.net/Change_c...ler_at_runtime

Cheers

Bruno


Re: Re: UninstallCaption problem
Or, try using this plug-in:

http://nsis.sourceforge.net/MessageBox_plug-in

Cheers

Bruno