Skip to content
⌘ NSIS Forum Archive

Installer Progress Bar not graphically 100% completing

6 posts

gheilig#

Installer Progress Bar not graphically 100% completing

My NSIS installation program completely works.
There is just one thing that I would like to fix: The progress bar at the top of the last dialog box does not graphically display 100% complete even though a particular component Section does in fact complete 100% successfully.

I have searched this forum for any posts that might help me with this small problem but I could not find post that suggests a solution.

Please see the attachment to this post to see just how the progress bar fails to show a 100% completion even though the installed component Section does complete 100% successfully.

This happens only when the following installation component Section is run:



Section "Hub Unicode" HUB_U_SECTION_ID

; Set output path to the installation directory.
SetOutPath $INSTDIR

ClearErrors
File "..\Release\HubU.exe"
Push "Failed to copy HubU.exe into $OUTDIR"
Push "Succeeded in copying HubU.exe into $OUTDIR"
Call LogFailureWAbortOrSuccess

; Set the password into the registry.
ClearErrors
WriteRegStr HKLM "Software\Apex\Hub U" "pword" $ChosenPassword
${If} ${Errors}
!insertmacro _LogWrite 'Error while saving the password into the application registry!'
MessageBox MB_ICONSTOP|MB_OK \
'Error while saving the password into the application registry!'
${Else}
!insertmacro _LogWrite 'Successfully saved the password into the application registry!'
${EndIf}

; Set the Central into the registry.
ClearErrors
WriteRegStr HKLM "Software\Apex\Hub U" "central" $ChosenCentral
${If} ${Errors}
!insertmacro _LogWrite 'Error while saving the Central into the application registry!'
MessageBox MB_ICONSTOP|MB_OK 'Error while saving the Central into the application registry!'
${Else}
!insertmacro _LogWrite 'Successfully saved the Central into the application registry!'
${EndIf}

SetOverwrite off ; We don't want to overwrite a preexisting configuration file (for now)!
ClearErrors
File "..\HubU\hubu.cfg"
Push "Failed to copy hubu.cfg into $OUTDIR"
Push "Succeeded in copying hubu.cfg into $OUTDIR"
Call LogFailureWAbortOrSuccess
SetOverwrite on ; Resume overwriting preexisting files.

ClearErrors
CreateShortcut "$DESKTOP\HubU.lnk" "$OUTDIR\HubU.exe" \
"" "" "" SW_SHOWNORMAL "" "Hub Unicode For Apex"
Push "Failed to create a HubU shortcut onto the desktop at $DESKTOP"
Push "Succeeded in creating a HubU shortcut onto the desktop at $DESKTOP"
Call LogFailureWAbortOrSuccess

ClearErrors
CreateShortcut "$SMPROGRAMS\HubU.lnk" "$OUTDIR\HubU.exe" \
"" "" "" SW_SHOWNORMAL "" "Hub Unicode For Apex"
Push "Failed to create a HubU shortcut onto the startmenu at $SMPROGRAMS"
Push "Succeeded in creating a HubU shortcut onto the startmenu at $SMPROGRAMS"
Call LogFailureWAbortOrSuccess

; If Microsoft VC++ 12.0 is NOT installed on this host computer then we
; must run the appropriate Microsoft Visual C Redistributable in order
; to run Hub Unicode.
StrCmp $MSVCPPVersion12Installed 1 LeaveSection InstallRedistributable
LeaveSection:
Return
InstallRedistributable:
MessageBox MB_ICONINFORMATION|MB_OK \
"A Microsoft redistributable installation program must install support software that will allow $(^Name) to run.$\n$\nYou will have an opportunity to halt the execution of this Microsoft installation program if you wish to do so."
!insertmacro _LogWrite "Running the Microsoft VC++ 12.0 Redistributable installation program"
File "..\..\GlobalApexUnicodeFiles\vcredist_x86.exe"
Exec '$OUTDIR\vcredist_x86.exe'

SectionEnd
The progress bar does show 100% for the other component Section of my NSIS installation program. It is only for the Section above that it does not.

Thank you in advance for any help you can offer me!
aerDNA#
If there's an obvious reason, I'm missing it. If you don't find it, you should be able to use this as a fix:

Page instfiles "" "" FixProgressBar
Function FixProgressBar
!define PBM_SETPOS     0x0402
!define PBM_SETRANGE32 0x0406
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 1004
SendMessage $0 ${PBM_SETRANGE32} 0 100
SendMessage $0 ${PBM_SETPOS} 100 0
FunctionEnd 
[Edit] In the meantime it turns out there was an obvious reason. Isn't there a way do delete a post, it seems that I'm only able to edit?
gheilig#
Looking at my previous post: The "simple" fix is to simply move the "LeaveSection:" label to the bottom of the section.

I will copy the Function FixProgressBar for future reference in case I need it.

Thank you both your high quality answers to my problem!

By the way, if I want to donate to this forum or to the NSIS project how can I do it? I searched for a way to make a financial donation but I could not figure out how to do it.

Thanks again!
Anders#
Originally Posted by gheilig View Post
By the way, if I want to donate to this forum or to the NSIS project how can I do it? I searched for a way to make a financial donation but I could not figure out how to do it.
There should be a donate button somewhere on sourceforge.net/projects/nsis/

Edit: http://sourceforge.net/p/nsis/donate/?source=navbar