|
@@ -515,18 +515,24 @@ var
|
|
|
else
|
|
|
RootKey := HKEY_CURRENT_USER;
|
|
|
SubkeyName := NEWREGSTR_PATH_UNINSTALL + '\' + UninstallRegKeyBaseName + '_is1';
|
|
|
+
|
|
|
+ Log('Deleting any uninstall keys left over from previous installs');
|
|
|
|
|
|
- { Delete any uninstall keys left over from previous installs }
|
|
|
RegDeleteKeyIncludingSubkeys(InstallDefaultRegView, HKEY_CURRENT_USER, PChar(SubkeyName));
|
|
|
if IsAdmin then
|
|
|
RegDeleteKeyIncludingSubkeys(InstallDefaultRegView, HKEY_LOCAL_MACHINE, PChar(SubkeyName));
|
|
|
|
|
|
+ LogFmt('Creating new uninstall key: %s\%s', [GetRegRootKeyName(RootKey), SubkeyName]);
|
|
|
+
|
|
|
{ Create uninstall key }
|
|
|
ErrorCode := RegCreateKeyExView(InstallDefaultRegView, RootKey, PChar(SubkeyName),
|
|
|
0, nil, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, nil, H2, nil);
|
|
|
if ErrorCode <> ERROR_SUCCESS then
|
|
|
RegError(reRegCreateKeyEx, RootKey, SubkeyName, ErrorCode);
|
|
|
+
|
|
|
try
|
|
|
+ Log('Writing uninstall key values.');
|
|
|
+
|
|
|
{ do not localize or change any of the following strings }
|
|
|
SetStringValue(H2, 'Inno Setup: Setup Version', SetupVersion);
|
|
|
if shCreateAppDir in SetupHeader.Options then
|
|
@@ -2118,7 +2124,7 @@ var
|
|
|
NotifyBeforeInstallEntry(BeforeInstall);
|
|
|
Log('-- Registry entry --');
|
|
|
S := ExpandConst(Subkey);
|
|
|
- LogFmt('Key: %s\%s', [GetRegRootKeyName(RootKey), Subkey]); {LOG rootkey}
|
|
|
+ LogFmt('Key: %s\%s', [GetRegRootKeyName(RootKey), Subkey]);
|
|
|
N := ExpandConst(ValueName);
|
|
|
if N <> '' then
|
|
|
LogFmt('Value name: %s', [N]);
|
|
@@ -2759,6 +2765,7 @@ var
|
|
|
replacing an existing uninstall EXE, exit. }
|
|
|
if UninstallTempExeFilename = '' then
|
|
|
Exit;
|
|
|
+ Log('Renaming uninstaller.');
|
|
|
RetriesLeft := 4;
|
|
|
while True do begin
|
|
|
Timer.Start(1000);
|
|
@@ -2769,6 +2776,8 @@ var
|
|
|
if (LastError = ERROR_ACCESS_DENIED) or
|
|
|
(LastError = ERROR_SHARING_VIOLATION) then begin
|
|
|
if RetriesLeft > 0 then begin
|
|
|
+ LogFmt('The existing file appears to be in use (%d). ' +
|
|
|
+ 'Retrying.', [LastError]);
|
|
|
Dec(RetriesLeft);
|
|
|
Timer.SleepUntilExpired;
|
|
|
ProcessEvents;
|
|
@@ -2800,6 +2809,7 @@ var
|
|
|
do nothing }
|
|
|
if (UninstallExeCreated <> ueNone) and
|
|
|
((shSignedUninstaller in SetupHeader.Options) or DetachedUninstMsgFile) then begin
|
|
|
+ LogFmt('Writing uninstaller messages: %s', [UninstallMsgFilename]);
|
|
|
F := TFile.Create(UninstallMsgFilename, fdCreateAlways, faWrite, fsNone);
|
|
|
try
|
|
|
if UninstallExeCreated = ueNew then
|
|
@@ -3032,6 +3042,7 @@ begin
|
|
|
modifications you want to add must be done before this is called. }
|
|
|
if Uninstallable then begin
|
|
|
SetStatusLabelText(SetupMessages[msgStatusSavingUninstall]);
|
|
|
+ Log('Saving uninstall information.');
|
|
|
RenameUninstallExe;
|
|
|
CreateUninstallMsgFile;
|
|
|
{ Register uninstall information so the program can be uninstalled
|