Old 11th April 2017, 05:38   #1
monkeypirate83
Junior Member
 
Join Date: Aug 2016
Posts: 4
NSIS Hang

Hi,

I am building a custom installer using NSIS and I've created a few custom pages etc. however, when I load NSIS some times ( 1 in 10/15 times) it will hang shortly after calling nsdialog::show on the first page

This is the code I'm using for my first custom page:

code:

nsDialogs::Create 1018 ;CREATE BLANK PAGE
Pop $vPageDialog
SetCtlColors $vPageDialog 0xFFFFFF transparent ;SET WELCOME PAGE BACKGROUND TO TRANSPARENT

; Close out if errored
${If} $vPageDialog == error
Abort
${EndIf}

; Setup English Button / Text
${NSD_CreateButton} 20 145 28 28 "1033"
Pop $vHwnd
StrCpy $vSelectedLanguage $vHwnd
${NSD_OnClick} $vHwnd LanguageButtonSelected
${NSD_AddStyle} $vHwnd "${BS_BITMAP}"
System::Call 'user32::LoadImage(i 0, t "$PLUGINSDIR\selected.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s'
Pop $6
StrCpy $selectedLangButton $vHwnd
SendMessage $vHwnd ${BM_SETIMAGE} ${IMAGE_BITMAP} $6

${NSD_CreateButton} 20 185 28 28 "1036"
Pop $vHwnd
${NSD_OnClick} $vHwnd LanguageButtonSelected
${NSD_AddStyle} $vHwnd "${BS_BITMAP}"
System::Call 'user32::LoadImage(i 0, t "$PLUGINSDIR\deselected.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s'
Pop $6
StrCpy $selectedLangButton $vHwnd
SendMessage $vHwnd ${BM_SETIMAGE} ${IMAGE_BITMAP} $6

${NSD_CreateButton} 20 225 28 28 "1040"
Pop $vHwnd
${NSD_OnClick} $vHwnd LanguageButtonSelected
${NSD_AddStyle} $vHwnd "${BS_BITMAP}"
System::Call 'user32::LoadImage(i 0, t "$PLUGINSDIR\deselected.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s'
Pop $6
StrCpy $selectedLangButton $vHwnd
SendMessage $vHwnd ${BM_SETIMAGE} ${IMAGE_BITMAP} $6

${NSD_CreateButton} 20 265 28 28 "1031"
Pop $vHwnd
${NSD_OnClick} $vHwnd LanguageButtonSelected
${NSD_AddStyle} $vHwnd "${BS_BITMAP}"
System::Call 'user32::LoadImage(i 0, t "$PLUGINSDIR\deselected.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s'
Pop $6
StrCpy $selectedLangButton $vHwnd
SendMessage $vHwnd ${BM_SETIMAGE} ${IMAGE_BITMAP} $6

${NSD_CreateButton} 20 305 28 28 "1034"
Pop $vHwnd
${NSD_OnClick} $vHwnd LanguageButtonSelected
${NSD_AddStyle} $vHwnd "${BS_BITMAP}"
System::Call 'user32::LoadImage(i 0, t "$PLUGINSDIR\deselected.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s'
Pop $6
StrCpy $selectedLangButton $vHwnd
SendMessage $vHwnd ${BM_SETIMAGE} ${IMAGE_BITMAP} $6

${NSD_CreateButton} 20 345 28 28 "3082"
Pop $vHwnd
${NSD_OnClick} $vHwnd LanguageButtonSelected
${NSD_AddStyle} $vHwnd "${BS_BITMAP}"
System::Call 'user32::LoadImage(i 0, t "$PLUGINSDIR\deselected.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s'
Pop $6
StrCpy $selectedLangButton $vHwnd
SendMessage $vHwnd ${BM_SETIMAGE} ${IMAGE_BITMAP} $6

${NSD_CreateButton} 20 385 28 28 "1046"
Pop $vHwnd
${NSD_OnClick} $vHwnd LanguageButtonSelected
${NSD_AddStyle} $vHwnd "${BS_BITMAP}"
System::Call 'user32::LoadImage(i 0, t "$PLUGINSDIR\deselected.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s'
Pop $6
StrCpy $selectedLangButton $vHwnd
SendMessage $vHwnd ${BM_SETIMAGE} ${IMAGE_BITMAP} $6

${NSD_CreateButton} 450 145 28 28 "1049"
Pop $vHwnd
${NSD_OnClick} $vHwnd LanguageButtonSelected
${NSD_AddStyle} $vHwnd "${BS_BITMAP}"
System::Call 'user32::LoadImage(i 0, t "$PLUGINSDIR\deselected.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s'
Pop $6
StrCpy $selectedLangButton $vHwnd
SendMessage $vHwnd ${BM_SETIMAGE} ${IMAGE_BITMAP} $6

${NSD_CreateButton} 450 185 28 28 "1045"
Pop $vHwnd
${NSD_OnClick} $vHwnd LanguageButtonSelected
${NSD_AddStyle} $vHwnd "${BS_BITMAP}"
System::Call 'user32::LoadImage(i 0, t "$PLUGINSDIR\deselected.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s'
Pop $6
StrCpy $selectedLangButton $vHwnd
SendMessage $vHwnd ${BM_SETIMAGE} ${IMAGE_BITMAP} $6

${NSD_CreateButton} 450 225 28 28 "1041"
Pop $vHwnd
${NSD_OnClick} $vHwnd LanguageButtonSelected
${NSD_AddStyle} $vHwnd "${BS_BITMAP}"
System::Call 'user32::LoadImage(i 0, t "$PLUGINSDIR\deselected.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s'
Pop $6
StrCpy $selectedLangButton $vHwnd
SendMessage $vHwnd ${BM_SETIMAGE} ${IMAGE_BITMAP} $6

${NSD_CreateButton} 450 265 28 28 "2052"
Pop $vHwnd
${NSD_OnClick} $vHwnd LanguageButtonSelected
${NSD_AddStyle} $vHwnd "${BS_BITMAP}"
System::Call 'user32::LoadImage(i 0, t "$PLUGINSDIR\deselected.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s'
Pop $6
StrCpy $selectedLangButton $vHwnd
SendMessage $vHwnd ${BM_SETIMAGE} ${IMAGE_BITMAP} $6

${NSD_CreateButton} 450 305 28 28 "2052"
Pop $vHwnd
${NSD_OnClick} $vHwnd LanguageButtonSelected
${NSD_AddStyle} $vHwnd "${BS_BITMAP}"
System::Call 'user32::LoadImage(i 0, t "$PLUGINSDIR\deselected.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s'
Pop $6
StrCpy $selectedLangButton $vHwnd
SendMessage $vHwnd ${BM_SETIMAGE} ${IMAGE_BITMAP} $6

${NSD_CreateButton} 450 345 28 28 "1042"
Pop $vHwnd
${NSD_OnClick} $vHwnd LanguageButtonSelected
${NSD_AddStyle} $vHwnd "${BS_BITMAP}"
System::Call 'user32::LoadImage(i 0, t "$PLUGINSDIR\deselected.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s'
Pop $6
StrCpy $selectedLangButton $vHwnd
SendMessage $vHwnd ${BM_SETIMAGE} ${IMAGE_BITMAP} $6


!insertmacro Output "pageLanguage Create Text Labels"

; Text English
${NSD_CreateLabel} 60 147 250 28 "$LanEng"
Pop $vHwnd
!insertmacro SetLangFonts $vHwnd "HelveticaNeueW02-55" 14 0x000000 Transparent 400

; Text French
${NSD_CreateLabel} 60 187 250 28 "$LanFra"
Pop $vHwnd
!insertmacro SetLangFonts $vHwnd "HelveticaNeueW02-55" 14 0x000000 Transparent 400

; Text Italian
${NSD_CreateLabel} 60 227 250 28 "$LanIta"
Pop $vHwnd
!insertmacro SetLangFonts $vHwnd "HelveticaNeueW02-55" 14 0x000000 Transparent 400

; Text German
${NSD_CreateLabel} 60 267 250 28 "$LanGer"
Pop $vHwnd
!insertmacro SetLangFonts $vHwnd "HelveticaNeueW02-55" 14 0x000000 Transparent 400

; Text Spanish
${NSD_CreateLabel} 60 307 250 28 "$LanEsp"
Pop $vHwnd
!insertmacro SetLangFonts $vHwnd "HelveticaNeueW02-55" 14 0x000000 Transparent 400

; Text Spanish Mexican
${NSD_CreateLabel} 60 347 250 28 "$LanEsM"
Pop $vHwnd
!insertmacro SetLangFonts $vHwnd "HelveticaNeueW02-55" 14 0x000000 Transparent 400

; Text Portuguese
${NSD_CreateLabel} 60 387 250 28 "$LanPor"
Pop $vHwnd
!insertmacro SetLangFonts $vHwnd "HelveticaNeueW02-55" 14 0x000000 Transparent 400

; Text Russian
${NSD_CreateLabel} 490 147 250 28 "$LanRus"
Pop $vHwnd
!insertmacro SetLangFonts $vHwnd "HelveticaNeueW02-55" 14 0x000000 Transparent 400

; Text Polish
${NSD_CreateLabel} 490 187 250 28 "$LanPol"
Pop $vHwnd
!insertmacro SetLangFonts $vHwnd "HelveticaNeueW02-55" 14 0x000000 Transparent 400

; Text Japanese
${NSD_CreateLabel} 490 227 250 28 "$LanJpn"
Pop $vHwnd
!insertmacro SetLangFonts $vHwnd "HelveticaNeueW02-55" 14 0x000000 Transparent 400

; Text Chinese Simple
${NSD_CreateLabel} 490 267 250 28 "$LanChiS"
Pop $vHwnd
!insertmacro SetLangFonts $vHwnd "HelveticaNeueW02-55" 14 0x000000 Transparent 400

; Text Chinese Trad
${NSD_CreateLabel} 490 307 250 28 "$LanChi"
Pop $vHwnd
!insertmacro SetLangFonts $vHwnd "HelveticaNeueW02-55" 14 0x000000 Transparent 400

; Text Korean
${NSD_CreateLabel} 490 347 250 28 "$LanKor"
Pop $vHwnd
!insertmacro SetLangFonts $vHwnd "HelveticaNeueW02-55" 14 0x000000 Transparent 400

nsDialogs::Show ; Show Page



It's driving me insane, when it hangs I can't connect process explorer to see the stacks (or any info tbh)

Any help would be greatly appriciated.

Thanks
monkeypirate83 is offline   Reply With Quote
Old 11th April 2017, 15:43   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,588
NSIS version? Windows version?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump