Skip to content
⌘ NSIS Forum Archive

installer window loosing focus

14 posts

dfranklin72#

installer window loosing focus

using custom page leave function seems to make the installer window loose focus while its processing a task. Is there something I’m doing wrong?
dfranklin72#
I'm running a number of batch sripts and installs in the leave function. Im also using the leave to post HTML data.
dfranklin72#
a mixture of:
nsExec::Exec
exewait
and some pluggins:

inetc:😛ost
ebanner

the idea was to check some credentials with the post then run scripts with the output from the post. This intern modifies the packages and then runs them. while playing some images and showing progress all in a custom page.

Simple?
dfranklin72#
I have moved most of the process this morning into the install section of MUI but I still have the problem with the user signup and serial activation. It currently requires the user to input details then it send them in a post via web services for validation checks. Do I need to run this in a single function and add a submit button to the page?
dfranklin72#
page custom serial serialleave


Function serial

nsDialogs::Create 1044
Pop $Dialog
${If} $Dialog == error
Abort

${EndIF}
GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 0

${NSD_CreateText} 37 230 50 20 $Serial1
Pop $Text5
${NSD_CreateText} 127 230 50 20 $Serial2
Pop $Text6
${NSD_CreateText} 217 230 50 20 $Serial3
Pop $Text7
${NSD_CreateText} 307 230 50 20 $Serial4
Pop $Text8
${NSD_SetFocus} $Text5


${NSD_SetTextLimit} $Text5 4
${NSD_SetTextLimit} $Text6 4
${NSD_SetTextLimit} $Text7 4
${NSD_SetTextLimit} $Text8 4


${NSD_OnChange} $text8 enableNext

${NSD_CreateBitmap} 0u 0u 100% 100% ""
Pop $Image
${NSD_SetImage} $Image $PLUGINSDIR\page2 $ImageHandle
nsDialogs::Show
${NSD_FreeImage} $ImageHandle
nsDialogs::Show



FunctionEnd

Function SerialLeave

GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 0

${NSD_GetText} $Text5 $Serial1
${NSD_GetText} $Text6 $Serial2
${NSD_GetText} $Text7 $Serial3
${NSD_GetText} $Text8 $Serial4

inetc:😛ost "ProtectorSerialKey=$Serial1$Serial2$Serial3$Serial4" /SILENT /HEADER "Content-Type:application/x-www-form-urlencoded" \
"hostX.X.X.X" "$TEMP\post_reply.txt"

Push "$TEMP\post_reply.txt"
push "Serial Key registered"
Call FileSearch
Pop $0
${if} $0 = 1
#MessageBox MB_OK|MB_ICONINFORMATION "Serial Key registered OK"
call enableNEXT
${else}
Push "$TEMP\post_reply.txt"
Push "Serial Key not recognised"
Call FileSearch
Pop $0
${if} $0 = 1
MessageBox MB_OK|MB_ICONINFORMATION "Serial Key not recognised"
abort
${else}
Push "$TEMP\post_reply.txt"
Push "Serial Key has already been registered"
Call FileSearch
Pop $0
${if} $0 = 1
MessageBox MB_OK|MB_ICONINFORMATION "Serial key already registered"
abort
${else}
MessageBox MB_OK|MB_ICONINFORMATION "An unknown error has occured please contact your Service provider"
abort
${endif}

${endif}
${endif}
${NSD_FreeImage} $ImageHandle



FunctionEnd
dfranklin72#
not sure what you mean.

I run the serial function, wait for the results then a seperate signup function then install. I need the results of the serial function to complete the signup. this means I can't just place the posts in the install section.
Afrow UK#
What you have now is fine. Send the web request in your page's leave function. Everything else can be done in a section.

Stu
Afrow UK#
You mean the installer window no longer has focus or some of your serial box fields when Abort is called?

NSIS has a BringToFront instruction. To set focus on the text fields you can use NSD_SetFocus.

Stu