summaryrefslogtreecommitdiff
path: root/src/burn/engine/registration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn/engine/registration.cpp')
-rw-r--r--src/burn/engine/registration.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/burn/engine/registration.cpp b/src/burn/engine/registration.cpp
index 0117a993..01ed30d7 100644
--- a/src/burn/engine/registration.cpp
+++ b/src/burn/engine/registration.cpp
@@ -10,6 +10,7 @@ const LPCWSTR REGISTRY_RUN_ONCE_KEY = L"SOFTWARE\\Microsoft\\Windows\\CurrentVer
10const LPCWSTR REGISTRY_BUNDLE_DISPLAY_ICON = L"DisplayIcon"; 10const LPCWSTR REGISTRY_BUNDLE_DISPLAY_ICON = L"DisplayIcon";
11const LPCWSTR REGISTRY_BUNDLE_DISPLAY_VERSION = L"DisplayVersion"; 11const LPCWSTR REGISTRY_BUNDLE_DISPLAY_VERSION = L"DisplayVersion";
12const LPCWSTR REGISTRY_BUNDLE_ESTIMATED_SIZE = L"EstimatedSize"; 12const LPCWSTR REGISTRY_BUNDLE_ESTIMATED_SIZE = L"EstimatedSize";
13const LPCWSTR REGISTRY_BUNDLE_INSTALL_DATE = L"InstallDate";
13const LPCWSTR REGISTRY_BUNDLE_PUBLISHER = L"Publisher"; 14const LPCWSTR REGISTRY_BUNDLE_PUBLISHER = L"Publisher";
14const LPCWSTR REGISTRY_BUNDLE_HELP_LINK = L"HelpLink"; 15const LPCWSTR REGISTRY_BUNDLE_HELP_LINK = L"HelpLink";
15const LPCWSTR REGISTRY_BUNDLE_HELP_TELEPHONE = L"HelpTelephone"; 16const LPCWSTR REGISTRY_BUNDLE_HELP_TELEPHONE = L"HelpTelephone";
@@ -610,6 +611,7 @@ extern "C" HRESULT RegistrationSessionBegin(
610 HKEY hkRegistration = NULL; 611 HKEY hkRegistration = NULL;
611 BOOL fCreated = FALSE; 612 BOOL fCreated = FALSE;
612 LPWSTR sczPublisher = NULL; 613 LPWSTR sczPublisher = NULL;
614 SYSTEMTIME systime = { };
613 DWORD er = ERROR_SUCCESS; 615 DWORD er = ERROR_SUCCESS;
614 616
615 AssertSz(BOOTSTRAPPER_REGISTRATION_TYPE_NONE != registrationType, "Registration type can't be NONE"); 617 AssertSz(BOOTSTRAPPER_REGISTRATION_TYPE_NONE != registrationType, "Registration type can't be NONE");
@@ -814,10 +816,17 @@ extern "C" HRESULT RegistrationSessionBegin(
814 ExitOnFailure(hr, "Failed to write update registration."); 816 ExitOnFailure(hr, "Failed to write update registration.");
815 } 817 }
816 818
817 // Only set estimated size here for the first time. 819 // Only set install date and initial estimated size here for the first time.
818 // It will always get updated at the end of the session. 820 // Estimated size will always get updated at the end of the session.
819 if (fCreated) 821 if (fCreated)
820 { 822 {
823 // Write the install date.
824 ::GetLocalTime(&systime);
825
826 hr = RegWriteStringFormatted(hkRegistration, REGISTRY_BUNDLE_INSTALL_DATE, L"%04u%02u%02u", systime.wYear, systime.wMonth, systime.wDay);
827 ExitOnFailure(hr, "Failed to write %ls value.", REGISTRY_BUNDLE_INSTALL_DATE);
828
829 // Write the initial estimated size.
821 hr = UpdateEstimatedSize(hkRegistration, qwEstimatedSize); 830 hr = UpdateEstimatedSize(hkRegistration, qwEstimatedSize);
822 ExitOnFailure(hr, "Failed to update estimated size."); 831 ExitOnFailure(hr, "Failed to update estimated size.");
823 } 832 }