Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7053273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:29:05+00:00 2026-05-28T03:29:05+00:00

im working on a project where im using NSI to create a setup myproject.exe

  • 0

im working on a project where im using NSI to create a setup myproject.exe,
everything works fine, but i want to dump the log that is displayed into a file, that also works fine, but my problem is i cant figure out when to call the log function

i have 12 sections in my script , i got the function to create the installation log from Dump log to file

 !define PRODUCT_NAME "myApplication"
 !define PRODUCT_VERSION "1.7.1"
 !define LVM_GETITEMCOUNT 0x1004
 !define LVM_GETITEMTEXT 0x102D
 !include MUI2.nsh


  Name "myExe"
  OutFile "C:\myExe.exe"

  InstallDir $PROGRAMFILES\myprojc
  InstallDirRegKey HKCU "Software\myprojc" "Install_Dir"

  !define MUI_ABORTWARNING      
  !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\Folder-Options.ico"
  !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
  !define MUI_HEADERIMAGE
  !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\Banner.bmp" 

    ; Pages

  !insertmacro MUI_PAGE_WELCOME
  !insertmacro MUI_PAGE_COMPONENTS
  !insertmacro MUI_PAGE_DIRECTORY
  !insertmacro MUI_PAGE_INSTFILES

   !insertmacro MUI_UNPAGE_WELCOME
  !insertmacro MUI_UNPAGE_CONFIRM
  !insertmacro MUI_UNPAGE_INSTFILES
  !insertmacro MUI_UNPAGE_FINISH

    ;Languages

 !insertmacro MUI_LANGUAGE "English"
 BrandingText "myProj version 1.7.1"

 ;Here My section are decribed.. 12 of them
 Section "main program and components" section1
     ;main promgram files are copied

 SectionEnd

 Section "other DLL" section2
 ;copy the DLLs
 SectionEnd

 Section "Text files" section3
 ;copy the required txt files
 SectionEnd

  ;-....
  ;...

 Section "install BDE admin" section12
  ;copy install BDE admin

    ;Calling the Dumplog function to create the log file
     StrCpy $0 "$INSTDIR\Query\Presleyinstall.log"
     Push $0
     Call DumpLog
 SectionEnd


;The function dumps the to a log file
 Function DumpLog
 Exch $5
 Push $0
 Push $1
 Push $2
 Push $3
 Push $4
 Push $6

 FindWindow $0 "#32770" "" $HWNDPARENT
 GetDlgItem $0 $0 1016
StrCmp $0 0 exit
FileOpen $5 $5 "w"
StrCmp $5 "" exit
SendMessage $0 ${LVM_GETITEMCOUNT} 0 0 $6
System::Alloc ${NSIS_MAX_STRLEN}
Pop $3
StrCpy $2 0
System::Call "*(i, i, i, i, i, i, i, i, i) i \
  (0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1"
loop: StrCmp $2 $6 done
  System::Call "User32::SendMessageA(i, i, i, i) i \
    ($0, ${LVM_GETITEMTEXT}, $2, r1)"
  System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)"
  FileWrite $5 "$4$\r$\n"
  IntOp $2 $2 + 1
  Goto loop
done:
  FileClose $5
  System::Free $1
  System::Free $3
exit:
  Pop $6
  Pop $4
  Pop $3
  Pop $2
  Pop $1
   Pop $0
  Exch $5
FunctionEnd

Since i have called the dumplog function in section 12, the log file is only create when/if the section is selected by the user, if the section 12 is not selected then the dumplog function wont be called and log file will not be created,

so please tell me how do i call the dumplog function irrespective of the section is selected or not by the user, That is call the dumplog when the installation is complete.

EDIT

i can also try to create a section “Create installer log” and check it and disable like

 Section "Create installer log" section13
 SectionIn RO
 StrCpy $0 "$INSTDIR\myinstall.log"
 Push $0
 Call DumpLog
 SectionEnd

this enter image description here

but is there a way to call the dumplog function without section, and at the end of the installation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:29:06+00:00Added an answer on May 28, 2026 at 3:29 am

    If you don’t give the section a name (or start the name with -) then it will not be displayed on the components page:

    Section "Foobar"
    ;Install the optional Foobar
    SectionEnd
    
    Section
    ;Hidden section
    Section
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a project using Visual Studio(c#). I want to create a
I am working on a project using JavaMail. I want to access my Gmail
I'm working on a project using OpenCV on template matching, and I want to
I am working on a project using iOS3.2 SDK and also want to test
I am working on a project using sinatra with haml for templates. I want
I'm working on a project using C++. I want a TimerHandler to be called
I am working on a project using the Torque Engine 1.2 (mostly irrelevant but
I'm working on important project using Flex framework and i want to keep my
I'm working on a project using Windows 2008, .NET 3.5 and WCF for some
I am working on a project using rails 2.1.1. With the new release of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.