Skip to content
⌘ NSIS Forum Archive

Classic interface

10 posts

BarrelOfAGun#

Classic interface

Hi to everyone
Do you know the window where are the progress bar and where are written the extracted files?
I would want to make so that once completed the installation this window gets closed and an other appear where it asks if you want launch the application. All this happens with the modern interface, but not with that classic one.

this is my code


; Script generated by the HM NIS Edit Script Wizard.

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "MyApp"
!define PRODUCT_VERSION "2.05"
!define PRODUCT_PUBLISHER "Rand0m"

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "Update.exe"
LoadLanguageFile "${NSISDIR}\Contrib\Language files\Italian.nlf"
InstallDir "$PROGRAMFILES\MyApp 2"
Icon "${NSISDIR}\Contrib\Graphics\Icons\classic-install.ico"
DirText "Il setup installerÃ_ $(^Name) nella seguente cartella.$\r$\n$\r$\nPer installare in una cartella differente, clicca Sfoglia and seleziona un'altra cartella."
ShowInstDetails show
XPStyle on

Section "SezionePrincipale" SEC01
SetOutPath "$INSTDIR"
SetOverwrite on
File "allmyfiles.png"
SectionEnd
Help me!
BarrelOfAGun#
Once launch the commands !include nsDialogs.nsh which are the commands to create a custom dialog?

Sorry i'm a newbie ^^''
BarrelOfAGun#
Ok, is successful. Now how can I retrieve the state of the checkbox when page nsDialogsBlah gets closed?


!include nsDialogs.nsh
!include LogicLib.nsh

!define PRODUCT_NAME "MyApp"
!define PRODUCT_VERSION "2.05"
!define PRODUCT_PUBLISHER "Rand0m"

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "Update.exe"
LoadLanguageFile "${NSISDIR}\Contrib\Language files\Italian.nlf"
InstallDir "$PROGRAMFILES\MyApp 2"
Icon "${NSISDIR}\Contrib\Graphics\Icons\classic-install.ico"
DirText "some text"

ShowInstDetails show
XPStyle on

Page license /ENABLECANCEL
Page directory /ENABLECANCEL
Page instfiles /ENABLECANCEL
Page custom nsDialogsBlah ValidateCustom /ENABLECANCEL

Var CHECKBOX
Var DIALOG

Function nsDialogsBlah

nsDialogs::Create /NOUNLOAD 1018
Pop $0
GetFunctionAddress $0 OnBack
nsDialogs::OnBack /NOUNLOAD $0

${NSD_CreateCheckbox} 0 -50 100% 8u 1 Test
Pop $CHECKBOX
GetFunctionAddress $0 OnClick
nsDialogs::OnClick /NOUNLOAD $0

nsDialogs::Show

FunctionEnd

Function OnBack

MessageBox MB_YESNO "are you sure?" IDYES +2
Abort

FunctionEnd

Function OnClick

MessageBox MB_OK "checkbox clicked"

FunctionEnd

Section "SezionePrincipale" SEC01
SetOutPath "$INSTDIR"
SetOverwrite on
File "allmyfiles.png"
SectionEnd
kichik#
Define a leave callback function for the custom page and send ${BM_GETSTATE} to the check box to get its state.
Function leave
SendMessage $CHECKBOX ${BM_GETSTATE} 0 0 $0
${If} $0 != 0
MessageBox MB_OK checked!
${EndIf}
FunctionEnd
BarrelOfAGun#
Thank you very much! 😉
A last thing: how I should do to mark the checkbox automatically?
BarrelOfAGun#
SendMessage $CHECKBOX ${BM_SETSTATE} 1 1 $0

Is the right usage? The checkbox is unchecked but the application run same one!
kichik#
Actually, it should be BM_SETCHECK with BST_CHECKED.
SendMessage $CHECKBOX ${BM_SETCHECK} ${BST_CHECKED} 0