Archive: Checking for updates on the Internet / Changing Buttons


Checking for updates on the Internet / Changing Buttons
  Hello everybody i have two request.

I wrote an installer that figures out which software packages are installed and which are needed and after validatition downloading the needed packages inside the sections and executing them.


First request is the following: Because of the fact that the versions of the installed packages are changing from time to time. I made a single controllfile where i can manage required/supported versions in a single stringchain define without changing the the nsi script file. after compiling, the installer has a new version number. my installer itself is looking on any start, if there is a newer version of the installer on the internet and on positive return he downloads the new installer version execute the new installer with nsExec::Exec "$EXEDIR\<newinstaller>" and quits the "old" Installer with "Quit". For example:



#direct

#Versionsupdate ohne Proxy
>inetc::get /noproxy /caption "Installer update" /banner "Installer Update" /nocancel "${INSTALLER_BASEURL}/$R1" "$EXEDIR\$R1" /end
Pop $R0
StrCmp $R0"OK" +3
MessageBox MB_OK "Failure xyz"
>Abort

nsExec
::Exec "$EXEDIR\$R1"
>Quit
>
That works good, except that the old installer dosnt quit and instead freezes in and crashes and only can be closed by the task manager. Is there any "trick" to close the "old" installer and open the "new" one?


My second request deals with the buttons in sections. I have several sections which are showen when they are needed. Is there any possibility to change the text of the installbutton to "next" or something instead of "install". Also the cancelbutton is disabled in all sections, how can i activate it?

Thank you in advance for your efforts.

Use Exec not nsExec. nsExec is only for console applications.

Stu


Thank you, its working fine now.

Is it possible to change Text of the "install" Button within SectionsPage and make the "cancel" Button active?


To change next button text:

GetDlgItem $R0 $HWNDPARENT 1
SendMessage $R0 ${WM_SETTEXT} `` `STR:Install`

This requires !include WinMessages.nsh if you get compiler warnings.

Also search the forum for "enable cancel button".

Stu


Thank you, that worked well.
I found a second way to change the text of the next button by just adding

InstallButtonText "$(LANG_CUSTOMINSTALLBUTTONTEXT)"

It changes the "next button" for all section pages (i have more than one section)