mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-11 18:51:41 +00:00
Cleanup Debug engine GUID which interfer with PyTools
This commit is contained in:
parent
c2119d6c31
commit
5809caee89
2 changed files with 78 additions and 0 deletions
|
|
@ -131,6 +131,11 @@ begin
|
|||
or RegKeyExists(HKLM,'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\Projects\{FAE04EC0-301F-11d3-BF4B-00C04F79EFBC}');
|
||||
end;
|
||||
|
||||
function PythonTools2013_Installed: Boolean;
|
||||
begin
|
||||
Result := RegKeyExists(HKLM,'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7AD18985-A5E6-443D-B0AB-A9ECFBB389A0}');
|
||||
end;
|
||||
|
||||
function Fsharp2013_Installed(dummy: string): Boolean;
|
||||
begin
|
||||
Result := RegKeyExists(HKLM,'SOFTWARE\Microsoft\VisualStudio\12.0\Projects\{f2a71f9b-5d33-465a-a702-920d77279786}')
|
||||
|
|
|
|||
|
|
@ -1,4 +1,77 @@
|
|||
[Code]
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
function GetUninstallString(): String;
|
||||
var
|
||||
sUnInstPath: String;
|
||||
sUnInstallString: String;
|
||||
begin
|
||||
sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#emit SetupSetting("AppId")}_is1');
|
||||
sUnInstallString := '';
|
||||
if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
|
||||
RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
|
||||
Result := sUnInstallString;
|
||||
end;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
function IsUpgrade(): Boolean;
|
||||
begin
|
||||
Result := (GetUninstallString() <> '');
|
||||
end;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Uninstall previously installed application.
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
function UnInstallOldVersion(): Integer;
|
||||
var
|
||||
sUnInstallString: String;
|
||||
iResultCode: Integer;
|
||||
begin
|
||||
// Return Values:
|
||||
// 1 - uninstall string is empty
|
||||
// 2 - error executing the UnInstallString
|
||||
// 3 - successfully executed the UnInstallString
|
||||
|
||||
// default return value
|
||||
Result := 0;
|
||||
|
||||
// get the uninstall string of the old app
|
||||
sUnInstallString := GetUninstallString();
|
||||
if sUnInstallString <> '' then begin
|
||||
sUnInstallString := RemoveQuotes(sUnInstallString);
|
||||
if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
|
||||
Result := 3
|
||||
else
|
||||
Result := 2;
|
||||
end else
|
||||
Result := 1;
|
||||
end;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Uninstall previously installed application.
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
procedure CleanupInterferringWithPyToolsGuid;
|
||||
begin
|
||||
if not PythonTools2013_Installed then
|
||||
begin
|
||||
// Remove interferring registry string.
|
||||
RegDeleteKeyIncludingSubkeys(HKLM, 'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\CLSID\{8355452D-6D2F-41B0-89B8-BB2AA2529E94}')
|
||||
RegDeleteKeyIncludingSubkeys(HKLM, 'Software\Microsoft\VisualStudio\12.0\CLSID\{8355452D-6D2F-41B0-89B8-BB2AA2529E94}');
|
||||
end;
|
||||
end;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
procedure CurStepChanged(CurStep: TSetupStep);
|
||||
begin
|
||||
if (CurStep=ssInstall) then
|
||||
begin
|
||||
if (IsUpgrade()) then
|
||||
begin
|
||||
CleanupInterferringWithPyToolsGuid();
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
|
||||
var
|
||||
|
|
|
|||
Loading…
Reference in a new issue