@@ -65,6 +65,7 @@ struct KeyInfo
6565 bool Avail[KeysCount];
6666 RegKeyPath RegKey;
6767 FILETIME RegTime;
68+ TCHAR InstDate[10 ];
6869 REGSAM RegView;
6970 TCHAR SubKeyName[MAX_PATH];
7071 bool WindowsInstaller;
@@ -73,7 +74,8 @@ struct KeyInfo
7374 bool CanModify, CanRepair;
7475} *p = NULL ;
7576
76- bool ValidGuid (const TCHAR* guid) {
77+ bool ValidGuid (const TCHAR* guid)
78+ {
7779 const unsigned c_max_guid_len = 38 ;
7880 wchar_t buf[c_max_guid_len + 1 ];
7981 ZeroMemory (buf, sizeof (buf));
@@ -133,6 +135,7 @@ bool FillReg(KeyInfo& key, TCHAR* Buf, RegKeyPath& RegKey, REGSAM RegView)
133135 FileTimeToLocalFileTime (&key.RegTime , &ft);
134136 FileTimeToSystemTime (&ft, &st);
135137 wsprintf (sKeyTime , _T (" / %02u.%02u.%04u %u:%02u:%02u" ), st.wDay , st.wMonth , st.wYear , st.wHour , st.wMinute , st.wSecond );
138+ wsprintf (key.InstDate , _T (" %02u.%02u.%02u" ), st.wDay , st.wMonth , (st.wYear % 100 ));
136139 nKeyTimeLen = lstrlen (sKeyTime ) + 1 ;
137140 }
138141 for (int i=0 ;i<KeysCount;i++)
@@ -184,6 +187,24 @@ bool FillReg(KeyInfo& key, TCHAR* Buf, RegKeyPath& RegKey, REGSAM RegView)
184187 else
185188 {
186189 key.Avail [i] = TRUE ;
190+ if (i == InstallDate)
191+ {
192+ // 20101105
193+ if (lstrlen (key.Keys [i]) == 8 )
194+ {
195+ TCHAR *pszEnd = 0 ;
196+ DWORD ulDate = _tcstoul (key.Keys [i], &pszEnd, 10 );
197+ if (ulDate)
198+ {
199+ DWORD nDay = ulDate % 100 ; ulDate = (ulDate - nDay) / 100 ;
200+ DWORD nMon = ulDate % 100 ; ulDate = (ulDate - nMon) / 100 ;
201+ if (ulDate && nMon && nDay)
202+ {
203+ wsprintf (key.InstDate , _T (" %02u.%02u.%02u" ), nDay, nMon, (ulDate % 100 ));
204+ }
205+ }
206+ }
207+ }
187208 if (i == InstallDate && nKeyTimeLen) StringCchCat (key.Keys [i], ARRAYSIZE (key.Keys [i]), sKeyTime );
188209 }
189210 }
@@ -192,6 +213,9 @@ bool FillReg(KeyInfo& key, TCHAR* Buf, RegKeyPath& RegKey, REGSAM RegView)
192213 if ((key.Keys [ModifyPath][0 ] == 0 ) && (key.Keys [UninstallString][0 ] == 0 ))
193214 key.Hidden = true ;
194215
216+ if (key.InstDate [0 ] == 0 )
217+ StringCchCopy (key.InstDate , ARRAYSIZE (key.InstDate ), _T (" " ));
218+
195219 if (key.WindowsInstaller )
196220 {
197221 key.CanModify = !key.NoModify ;
@@ -306,8 +330,10 @@ void DisplayEntry(int Sel)
306330 FarDialogItem* DialogItems = new FarDialogItem[di_cnt];
307331 unsigned y = 2 ;
308332 unsigned idx = 1 ;
309- for (int i=0 ;i<KeysCount;i++) {
310- if (p[Sel].Avail [i]) {
333+ for (int i=0 ;i<KeysCount;i++)
334+ {
335+ if (p[Sel].Avail [i])
336+ {
311337 FillDialog (DialogItems[idx], DI_TEXT, 5 , y, 0 , y, 0 , MName + i);
312338 idx++;
313339 y++;
@@ -673,6 +699,8 @@ void UpDateInfo(void)
673699 else
674700 StringCchCat (text, MaxSize, sHKCU );
675701
702+ StringCchCat (text, MaxSize, _T (" " ));
703+ StringCchCat (text, MaxSize, p[i].InstDate );
676704 StringCchCat (text, MaxSize, _T (" " ));
677705 StringCchCat (text, MaxSize, (p[i].WindowsInstaller ) ? _T (" W" ) : _T (" " ));
678706 StringCchCat (text, MaxSize, (p[i].CanModify ) ? _T (" M" ) : _T (" " ));
0 commit comments