From 121211c0d8974104548d7590886366aa9d0ec2ad Mon Sep 17 00:00:00 2001 From: Keelan Stuart Date: Fri, 25 Sep 2020 21:25:11 -0400 Subject: [PATCH] Fixes and updates: - Added plain vanilla "accept license to continue" style license dialog - Fixed memory leak in package build - Fixed behavior when clicking close on progress dlg after install --- Archiver/Source/Archiver.cpp | 19 ++++--- Archiver/Source/FastLZArchiver.cpp | 1 + sfx/sfx/LicenseAcceptanceDlg.cpp | 84 +++++++++++++++++++++++++++++ sfx/sfx/LicenseAcceptanceDlg.h | 46 ++++++++++++++++ sfx/sfx/ProgressDlg.cpp | 4 +- sfx/sfx/TinyJS_SfxFunctions.cpp | 16 ++++++ sfx/sfx/TinyJS_SfxFunctions.h | 1 + sfx/sfx/resource.h | Bin 3818 -> 4000 bytes sfx/sfx/sfx.cpp | 20 ++++++- sfx/sfx/sfx.h | 2 + sfx/sfx/sfx.rc | Bin 25654 -> 26818 bytes sfx/sfx/sfx.vcxproj | 2 + sfx/sfx/sfx.vcxproj.filters | 6 +++ sfx/sfxPackager/OutputWnd.cpp | 13 +++-- sfx/sfxPackager/sfxPackager.rc | Bin 46376 -> 46376 bytes sfx/sfxPackager/sfxPackagerDoc.cpp | 74 ++++++++++++++----------- 16 files changed, 240 insertions(+), 48 deletions(-) create mode 100644 sfx/sfx/LicenseAcceptanceDlg.cpp create mode 100644 sfx/sfx/LicenseAcceptanceDlg.h diff --git a/Archiver/Source/Archiver.cpp b/Archiver/Source/Archiver.cpp index e97b2dd..855dfcb 100644 --- a/Archiver/Source/Archiver.cpp +++ b/Archiver/Source/Archiver.cpp @@ -15,7 +15,6 @@ IArchiver::CREATE_RESULT IArchiver::CreateArchiver(IArchiver **ppia, IArchiveHandle *pah, COMPRESSOR_TYPE ct) { - if (ppia) { DWORD bw; @@ -63,8 +62,11 @@ void IArchiver::DestroyArchiver(IArchiver **ppia) { if (ppia && *ppia) { - delete *ppia; - *ppia = NULL; + CFastLZArchiver *pflza = dynamic_cast(*ppia); + if (pflza) + delete pflza; + + *ppia = nullptr; } } @@ -75,14 +77,14 @@ IExtractor::CREATE_RESULT IExtractor::CreateExtractor(IExtractor **ppie, IArchiv { DWORD br; uint32_t magic; - ReadFile(pah->GetHandle(), &magic, sizeof(uint32_t), &br, NULL); + ReadFile(pah->GetHandle(), &magic, sizeof(uint32_t), &br, nullptr); if (magic != IArchiver::MAGIC) return CR_BADMAGIC; *ppie = NULL; - ReadFile(pah->GetHandle(), &magic, sizeof(uint32_t), &br, NULL); + ReadFile(pah->GetHandle(), &magic, sizeof(uint32_t), &br, nullptr); UINT64 flags; ReadFile(pah->GetHandle(), &flags, sizeof(uint64_t), &br, NULL); @@ -109,7 +111,10 @@ void IExtractor::DestroyExtractor(IExtractor **ppie) { if (ppie && *ppie) { - delete *ppie; - *ppie = NULL; + CFastLZExtractor *pflze = dynamic_cast(*ppie); + if (pflze) + delete pflze; + + *ppie = nullptr; } } diff --git a/Archiver/Source/FastLZArchiver.cpp b/Archiver/Source/FastLZArchiver.cpp index 5e658c9..2a8cf3c 100644 --- a/Archiver/Source/FastLZArchiver.cpp +++ b/Archiver/Source/FastLZArchiver.cpp @@ -42,6 +42,7 @@ CFastLZArchiver::CFastLZArchiver(IArchiveHandle *pah) CFastLZArchiver::~CFastLZArchiver() { + m_FileTable.clear(); } diff --git a/sfx/sfx/LicenseAcceptanceDlg.cpp b/sfx/sfx/LicenseAcceptanceDlg.cpp new file mode 100644 index 0000000..928bdfc --- /dev/null +++ b/sfx/sfx/LicenseAcceptanceDlg.cpp @@ -0,0 +1,84 @@ +/* + Copyright © 2013-2020, Keelan Stuart (hereafter referenced as AUTHOR). All Rights Reserved. + Permission to use, copy, modify, and distribute this software is hereby granted, without fee and without a signed licensing agreement, + provided that the above copyright notice appears in all copies, modifications, and distributions. + Furthermore, AUTHOR assumes no responsibility for any damages caused either directly or indirectly by the use of this software, nor vouches for + any fitness of purpose of this software. + All other copyrighted material contained herein is noted and rights attributed to individual copyright holders. + + For inquiries, contact: keelanstuart@gmail.com +*/ + + +#include "stdafx.h" +#include "sfx.h" +#include "LicenseAcceptanceDlg.h" +#include "afxdialogex.h" + + +// CLicenseAcceptanceDlg dialog + +IMPLEMENT_DYNAMIC(CLicenseAcceptanceDlg, CDialog) + +CLicenseAcceptanceDlg::CLicenseAcceptanceDlg(const TCHAR *description, CWnd *pParent) + : CDialog(IDD, pParent) +{ + m_hIcon = AfxGetApp()->LoadIcon(_T("ICON")); + + m_Desc = description; +} + +CLicenseAcceptanceDlg::~CLicenseAcceptanceDlg() +{ +} + +void CLicenseAcceptanceDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CLicenseAcceptanceDlg, CDialog) + ON_BN_CLICKED(IDC_CHECK_ACCEPTLICENSE, &CLicenseAcceptanceDlg::OnBnClickedCheckAcceptlicense) +END_MESSAGE_MAP() + + +// CLicenseAcceptanceDlg message handlers + + +void CLicenseAcceptanceDlg::OnCancel() +{ + CDialog::OnCancel(); +} + + +BOOL CLicenseAcceptanceDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + SetIcon(m_hIcon, TRUE); // Set big icon + SetIcon(m_hIcon, FALSE); // Set small icon + + m_CtlOk.SubclassDlgItem(IDOK, this); + + if (m_CtlDesc.CreateFromStatic(IDC_BROWSER, this)) + { + m_CtlDesc.LoadFromResource(_T("license")); + } + + if (m_CtlAcceptCB.SubclassDlgItem(IDC_CHECK_ACCEPTLICENSE, this)) + { + m_CtlOk.EnableWindow(false); + } + + ShowWindow(SW_SHOWNORMAL); + + return FALSE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + + +void CLicenseAcceptanceDlg::OnBnClickedCheckAcceptlicense() +{ + m_CtlOk.EnableWindow((m_CtlAcceptCB.GetCheck() > 0) ? TRUE : FALSE); +} diff --git a/sfx/sfx/LicenseAcceptanceDlg.h b/sfx/sfx/LicenseAcceptanceDlg.h new file mode 100644 index 0000000..cd7478e --- /dev/null +++ b/sfx/sfx/LicenseAcceptanceDlg.h @@ -0,0 +1,46 @@ +/* + Copyright © 2013-2020, Keelan Stuart (hereafter referenced as AUTHOR). All Rights Reserved. + Permission to use, copy, modify, and distribute this software is hereby granted, without fee and without a signed licensing agreement, + provided that the above copyright notice appears in all copies, modifications, and distributions. + Furthermore, AUTHOR assumes no responsibility for any damages caused either directly or indirectly by the use of this software, nor vouches for + any fitness of purpose of this software. + All other copyrighted material contained herein is noted and rights attributed to individual copyright holders. + + For inquiries, contact: keelanstuart@gmail.com +*/ + +#pragma once + + +#include "HtmlCtrl.h" + +// CLicenseKeyEntryDlg dialog + +class CLicenseAcceptanceDlg : public CDialog +{ + DECLARE_DYNAMIC(CLicenseAcceptanceDlg) + +public: + CLicenseAcceptanceDlg(const TCHAR *description, CWnd *pParent = nullptr); // standard constructor + virtual ~CLicenseAcceptanceDlg(); + +// Dialog Data + enum { IDD = IDD_LICENSE_DIALOG }; + +protected: + virtual void DoDataExchange(CDataExchange *pDX); // DDX/DDV support + + HICON m_hIcon; + CHtmlCtrl m_CtlDesc; + CButton m_CtlAcceptCB; + CButton m_CtlOk; + + CString m_Desc; + + + DECLARE_MESSAGE_MAP() + virtual void OnCancel(); +public: + virtual BOOL OnInitDialog(); + afx_msg void OnBnClickedCheckAcceptlicense(); +}; diff --git a/sfx/sfx/ProgressDlg.cpp b/sfx/sfx/ProgressDlg.cpp index 60f0abf..d390acc 100644 --- a/sfx/sfx/ProgressDlg.cpp +++ b/sfx/sfx/ProgressDlg.cpp @@ -736,9 +736,9 @@ UINT CProgressDlg::InstallThreadProc(LPVOID param) void CProgressDlg::OnSysCommand(UINT nID, LPARAM lParam) { - if (m_Thread && (nID == SC_CLOSE)) + if (nID == SC_CLOSE) { - if (MessageBox(_T("Do you really want to cancel this installation process and exit?"), _T("Confirm Exit"), MB_YESNO) == IDYES) + if (!m_Thread || (MessageBox(_T("Do you really want to cancel this installation process and exit?"), _T("Confirm Exit"), MB_YESNO) == IDYES)) ExitProcess(0); return; diff --git a/sfx/sfx/TinyJS_SfxFunctions.cpp b/sfx/sfx/TinyJS_SfxFunctions.cpp index 1fcc8da..4747568 100644 --- a/sfx/sfx/TinyJS_SfxFunctions.cpp +++ b/sfx/sfx/TinyJS_SfxFunctions.cpp @@ -736,6 +736,22 @@ void scAbortInstall(CScriptVar* c, void* userdata) } +void scShowLicenseAcceptanceDlg(CScriptVar *c, void *userdata) +{ + if (!theApp.m_LicenseAcceptanceDlg) + { + theApp.m_LicenseAcceptanceDlg = new CLicenseAcceptanceDlg(_T("")); + } + + INT_PTR dlg_ret = theApp.m_LicenseAcceptanceDlg->DoModal(); + + if (dlg_ret == IDCANCEL) + { + exit(-1); + } +} + + void scShowLicenseDlg(CScriptVar *c, void *userdata) { if (!theApp.m_LicenseDlg) diff --git a/sfx/sfx/TinyJS_SfxFunctions.h b/sfx/sfx/TinyJS_SfxFunctions.h index 50ad340..e6ab77c 100644 --- a/sfx/sfx/TinyJS_SfxFunctions.h +++ b/sfx/sfx/TinyJS_SfxFunctions.h @@ -24,6 +24,7 @@ extern void scSpawnProcess(CScriptVar *c, void *userdata); extern void scGetExeVersion(CScriptVar* c, void* userdata); extern void scCompareStrings(CScriptVar* c, void* userdata); extern void scAbortInstall(CScriptVar* c, void* userdata); +extern void scShowLicenseAcceptanceDlg(CScriptVar *c, void *userdata); extern void scShowLicenseDlg(CScriptVar *c, void *userdata); extern void scGetLicenseKey(CScriptVar *c, void *userdata); extern void scGetLicenseUser(CScriptVar *c, void *userdata); diff --git a/sfx/sfx/resource.h b/sfx/sfx/resource.h index c045c1924fe0512e48864f72228a7fdb87a6889c..8fb3e240821e4c8117ce3f7421a2bd74740fd982 100644 GIT binary patch delta 106 zcmaDQyFh-!66VPtm{@py7(5xA8C)6s7=jsGC;w;Cp8SBBh0$cPA+zMGV zm|VaoF!2J*qK-h-AoT$ZAq;T6ll|GnCkrsLFdH&hY;NRv$v9bwNo;ZhUlssu CW*o}^ delta 29 lcmZ1=|4Mel66VeSm>+R$w&8ukIQbTj*yI{Mk;z{CVF1FN3!eZ0 diff --git a/sfx/sfx/sfx.cpp b/sfx/sfx/sfx.cpp index 39416ea..943414b 100644 --- a/sfx/sfx/sfx.cpp +++ b/sfx/sfx/sfx.cpp @@ -49,6 +49,7 @@ CSfxApp::CSfxApp() { m_Flags = 0; m_LicenseDlg = nullptr; + m_LicenseAcceptanceDlg = nullptr; } @@ -168,6 +169,7 @@ BOOL CSfxApp::InitInstance() theApp.m_js.addNative(_T("function SetGlobalInt(name, val)"), scSetGlobalInt, (void *)this); theApp.m_js.addNative(_T("function SetProperty(name, type, aspect, value)"), scSetProperty, (void *)this); theApp.m_js.addNative(_T("function SetRegistryKeyValue(root, key, name, val)"), scSetRegistryKeyValue, (void *)this); + theApp.m_js.addNative(_T("function ShowLicenseAcceptanceDlg()"), scShowLicenseAcceptanceDlg, (void *)this); theApp.m_js.addNative(_T("function ShowLicenseDlg()"), scShowLicenseDlg, (void *)this); theApp.m_js.addNative(_T("function SpawnProcess(cmd, params, rundir, block)"), scSpawnProcess, (void *)this); theApp.m_js.addNative(_T("function TextFileOpen(filename, mode)"), scTextFileOpen, (void *)this); @@ -309,9 +311,10 @@ BOOL CSfxApp::InitInstance() UINT dt = runnow ? DT_PROGRESS : DT_FIRST; + CDialog *dlg = nullptr; while (dt != DT_QUIT) { - CDialog *dlg = CreateSfxDialog((ESfxDlgType)dt); + dlg = CreateSfxDialog((ESfxDlgType)dt); if (!dlg) break; @@ -356,8 +359,15 @@ BOOL CSfxApp::InitInstance() #endif m_pMainWnd = nullptr; + + delete dlg; + dlg = nullptr; + } + + if (dlg) + { delete dlg; - dlg = NULL; + dlg = nullptr; } // Delete the shell manager created above. @@ -385,6 +395,12 @@ BOOL CSfxApp::ExitInstance() m_LicenseDlg = nullptr; } + if (m_LicenseAcceptanceDlg) + { + delete m_LicenseAcceptanceDlg; + m_LicenseAcceptanceDlg = nullptr; + } + return TRUE; } diff --git a/sfx/sfx/sfx.h b/sfx/sfx/sfx.h index 5fa5572..6e58e0f 100644 --- a/sfx/sfx/sfx.h +++ b/sfx/sfx/sfx.h @@ -22,6 +22,7 @@ #include "resource.h" // main symbols #include "TinyJS.h" #include "LicenseEntryDlg.h" +#include "LicenseAcceptanceDlg.h" // CSfxApp: @@ -49,6 +50,7 @@ class CSfxApp : public CWinApp CTinyJS m_js; CLicenseKeyEntryDlg *m_LicenseDlg; + CLicenseAcceptanceDlg *m_LicenseAcceptanceDlg; enum EScriptType { diff --git a/sfx/sfx/sfx.rc b/sfx/sfx/sfx.rc index 17d735a6cac209eb5c440bf8a3f8a55e76036b52..e877ad1ff37702b0821a9a6d1c121d2432c0213a 100644 GIT binary patch delta 506 zcmYjNO-mb56uo1L9VASX7^P0Ej9IiXnZP7{(KNMC68gt^ zy2_%*RTYZhQY7-gMctKB-0CmrqRXLmQMz#D%Ycns9_QS1&gH)M&Mu^Hmr}jf2lYvq zuf~{!T3-@l(Hnsu;f;s+S3N1=Ix8ba07u!8Hz z)Ak`+5mlfHRcV<@4URv)BAj6O)i`NFYxC48$Ve5 G+WS delta 370 zcmX?fk#XAz#tnU%lb>iAO?J`=n=GJXG+9jh*XBOWFviIZx=NdO=@>C?mN3#`-&|s~ zL~8PZ(5T5Df?6h@2~wFH7sfZ)Aee9RhcG1|7MYwACN#N&Z^LGnh$t3keFl97PB08( zaAfdd2xV|(P+(AEaAwG7$Ym&CNMy)ksATX1(zy(&Kye+gtPN0YDMJZE22fSe zCo9B?$l3tSLK0`N1FGj`;DVUHd25U{BP-ad$?S2CP*!}LGlaEyXPhNWnlr&0Dwv&M z3=_;wkez%fQOg>agTsN&OJXQy$OJkI*`Y|{lh-Dk2Rc*$>`)|epn4>yZstzf&ISMh C+Epe1 diff --git a/sfx/sfx/sfx.vcxproj b/sfx/sfx/sfx.vcxproj index 099380f..d48421e 100644 --- a/sfx/sfx/sfx.vcxproj +++ b/sfx/sfx/sfx.vcxproj @@ -225,6 +225,7 @@ + @@ -250,6 +251,7 @@ + diff --git a/sfx/sfx/sfx.vcxproj.filters b/sfx/sfx/sfx.vcxproj.filters index b151765..b7fb560 100644 --- a/sfx/sfx/sfx.vcxproj.filters +++ b/sfx/sfx/sfx.vcxproj.filters @@ -131,6 +131,9 @@ Header Files + + Header Files + @@ -196,6 +199,9 @@ Source Files + + Source Files + diff --git a/sfx/sfxPackager/OutputWnd.cpp b/sfx/sfxPackager/OutputWnd.cpp index 9c1cb7d..f5cbf7b 100644 --- a/sfx/sfxPackager/OutputWnd.cpp +++ b/sfx/sfxPackager/OutputWnd.cpp @@ -185,11 +185,14 @@ void COutputList::OnContextMenu(CWnd* /*pWnd*/, CPoint point) { CMFCPopupMenu* pPopupMenu = new CMFCPopupMenu; - if (!pPopupMenu->Create(this, point.x, point.y, (HMENU)pSumMenu->m_hMenu, FALSE, TRUE)) - return; - - ((CMDIFrameWndEx*)AfxGetMainWnd())->OnShowPopupMenu(pPopupMenu); - UpdateDialogControls(this, FALSE); + if (pPopupMenu) + { + if (pPopupMenu->Create(this, point.x, point.y, (HMENU)pSumMenu->m_hMenu, FALSE, TRUE)) + { + ((CMDIFrameWndEx*)AfxGetMainWnd())->OnShowPopupMenu(pPopupMenu); + UpdateDialogControls(this, FALSE); + } + } } SetFocus(); diff --git a/sfx/sfxPackager/sfxPackager.rc b/sfx/sfxPackager/sfxPackager.rc index 23683bd5c6cdcc0311df5907e07aea9410cf28ee..22ff69001611714e65496da8452175a38427b4ab 100644 GIT binary patch delta 47 ycmZ4SifP3wrVUfl7)>VU7D#X2kfy-{WZoy_A7D#X2kfy-{WZodwSignature == 0xfeef04bd) + if (size) { - major = (verInfo->dwFileVersionMS >> 16) & 0xffff; - minor = (verInfo->dwFileVersionMS >> 0) & 0xffff; - release = (verInfo->dwFileVersionLS >> 16) & 0xffff; - build = (verInfo->dwFileVersionLS >> 0) & 0xffff; + VS_FIXEDFILEINFO *verInfo = (VS_FIXEDFILEINFO *)lpBuffer; + if (verInfo->dwSignature == 0xfeef04bd) + { + major = (verInfo->dwFileVersionMS >> 16) & 0xffff; + minor = (verInfo->dwFileVersionMS >> 0) & 0xffff; + release = (verInfo->dwFileVersionLS >> 16) & 0xffff; + build = (verInfo->dwFileVersionLS >> 0) & 0xffff; - if (retffi) - memcpy(retffi, verInfo, sizeof(VS_FIXEDFILEINFO)); + if (retffi) + memcpy(retffi, verInfo, sizeof(VS_FIXEDFILEINFO)); - ret = true; + ret = true; + } } } } - } - delete[] verData; + free(verData); + } } return ret; @@ -595,6 +598,12 @@ bool SetupSfxExecutable(const TCHAR *filename, CSfxPackagerDoc *pDoc, HANDLE &hF bresult = EndUpdateResource(hbur, FALSE); } + + if (pverinfo) + { + free(pverinfo); + pverinfo = nullptr; + } } hFile = CreateFile(filename, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); @@ -1495,7 +1504,8 @@ bool CSfxPackagerDoc::AddFileToArchive(CSfxPackagerView *pview, IArchiver *parc, msg.Format(_T(" WARNING: \"%s\" NOT FOUND!\r\n"), fullfilename); pmf->GetOutputWnd().AppendMessage(COutputWnd::OT_BUILD, msg); - return false; + ret = false; + break; } } } @@ -1619,11 +1629,11 @@ bool CSfxPackagerDoc::CreateSFXPackage(const TCHAR *filename, CSfxPackagerView * TCHAR timebuf[160]; struct tm * timeinfo; - timeinfo = localtime (&start_op); - _tcsftime(timebuf, 160, _T("%c"), timeinfo); + timeinfo = localtime(&start_op); + _tcsftime(timebuf, 160, _T("%R:%S %A, %e %B %Y"), timeinfo); auto pcaption = (*m_Props)[CSfxPackagerDoc::EDOCPROP::CAPTION]; - msg.Format(_T("[%s] Beginning build of \"%s\" (%s) ...\r\n"), timebuf, pcaption ? pcaption->AsString() : _T("???"), fullfilename); + msg.Format(_T("Beginning build of \"%s\" ---- [ %s ]\r\n\r\n Output File: %s\r\n\r\n"), pcaption ? pcaption->AsString() : fullfilename, timebuf, fullfilename); pmf->GetOutputWnd().AppendMessage(COutputWnd::OT_BUILD, msg); TStringArray created_archives; @@ -1637,10 +1647,10 @@ bool CSfxPackagerDoc::CreateSFXPackage(const TCHAR *filename, CSfxPackagerView * UINT spanct; uint64_t sz_uncomp = 0, sz_totalcomp = 0, sz_comp = 0; + CPackagerArchiveHandle *pah = nullptr; + DWORD wr = 0; { - CPackagerArchiveHandle *pah = nullptr; - auto parcmode = (*m_Props)[CSfxPackagerDoc::EDOCPROP::OUTPUT_MODE]; if (parcmode) { @@ -1751,12 +1761,6 @@ bool CSfxPackagerDoc::CreateSFXPackage(const TCHAR *filename, CSfxPackagerView * LARGE_INTEGER tsz = {0}; tsz.LowPart = GetFileSize(pah->GetHandle(), (LPDWORD)&tsz.HighPart); sz_totalcomp += tsz.QuadPart; - - if (pah) - { - pah->Release(); - pah = nullptr; - } } time(&finish_op); @@ -1769,15 +1773,15 @@ bool CSfxPackagerDoc::CreateSFXPackage(const TCHAR *filename, CSfxPackagerView * int seconds = elapsed % 60; timeinfo = localtime (&finish_op); - _tcsftime(timebuf, 160, _T("%c"), timeinfo); + _tcsftime(timebuf, 160, _T("%R:%S %A, %e %B %Y"), timeinfo); if ((wr == WAIT_OBJECT_0) || (wr == WAIT_ABANDONED)) { - msg.Format(_T("[%s] Cancelled. (after: %02d:%02d:%02d)\r\n"), timebuf, hours, minutes, seconds); + msg.Format(_T("\r\nCancelled build of \"%s\" ---- [ %s ]. (after: %02d:%02d:%02d)\r\n"), pcaption ? pcaption->AsString() : fullfilename, timebuf, hours, minutes, seconds); } else { - msg.Format(_T("[%s] Finished.\r\n\r\nAdded %d files, spanning %d archive(s).\r\n"), timebuf, parc->GetFileCount(IArchiver::IM_WHOLE), spanct); + msg.Format(_T("\r\nFinished build of \"%s\" ---- [ %s ].\r\n\r\nAdded %d files, spanning %d archive(s).\r\n"), pcaption ? pcaption->AsString() : fullfilename, timebuf, parc->GetFileCount(IArchiver::IM_WHOLE), spanct); pmf->GetOutputWnd().AppendMessage(COutputWnd::OT_BUILD, msg); double comp_pct = 0.0; @@ -1787,10 +1791,10 @@ bool CSfxPackagerDoc::CreateSFXPackage(const TCHAR *filename, CSfxPackagerView * { comp_pct = 100.0 * std::max(0.0, ((uncomp_sz / comp_sz) - 1.0)); } - msg.Format(_T("Uncompressed Size: %1.02fMB\r\nCompressed Size: %1.02fMB\r\nCompression: %1.02f%%\r\n\r\n"), uncomp_sz / 1024.0f / 1024.0f, comp_sz / 1024.0f / 1024.0f, comp_pct); + msg.Format(_T("Uncompressed size: %1.02fMB\r\nCompressed size (including installer overhead): %1.02fMB\r\nCompression: %1.02f%%\r\n\r\n"), uncomp_sz / 1024.0f / 1024.0f, comp_sz / 1024.0f / 1024.0f, comp_pct); pmf->GetOutputWnd().AppendMessage(COutputWnd::OT_BUILD, msg); - msg.Format(_T("Elapsed Time: %02d:%02d:%02d\r\n\r\n\r\n"), hours, minutes, seconds); + msg.Format(_T("Elapsed time: %02d:%02d:%02d\r\n\r\n\r\n"), hours, minutes, seconds); } pmf->GetOutputWnd().AppendMessage(COutputWnd::OT_BUILD, msg); @@ -1798,6 +1802,12 @@ bool CSfxPackagerDoc::CreateSFXPackage(const TCHAR *filename, CSfxPackagerView * pmf->GetStatusBarWnd().PostMessage(CProgressStatusBar::WM_UPDATE_STATUS, -1, 0); Sleep(0); + if (pah) + { + pah->Release(); + pah = nullptr; + } + IArchiver::DestroyArchiver(&parc); return ret;