|
| 1 | +// unins_previous.iss - Functionality to check for previous Elixir installations |
| 2 | +// Copyright 2014 Chris Hyndman |
| 3 | +// |
| 4 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +// you may not use this file except in compliance with the License. |
| 6 | +// You may obtain a copy of the License at |
| 7 | +// |
| 8 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +// |
| 10 | +// Unless required by applicable law or agreed to in writing, software |
| 11 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +// See the License for the specific language governing permissions and |
| 14 | +// limitations under the License. |
| 15 | + |
| 16 | +[Code] |
| 17 | +
|
| 18 | +function GetPreviousUninsExe: String; |
| 19 | +var |
| 20 | + UninsPath: String; |
| 21 | +begin |
| 22 | + UninsPath := ''; |
| 23 | + Result := ''; |
| 24 | + if RegQueryStringValue(HKLM, 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Elixir_is1', 'UninstallString', UninsPath) then begin |
| 25 | + Result := RemoveQuotes(UninsPath); |
| 26 | + end else if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Elixir_is1', 'UninstallString', UninsPath) then begin |
| 27 | + Result := RemoveQuotes(UninsPath); |
| 28 | + end else if RegQueryStringValue(HKCU, 'Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Elixir_is1', 'UninstallString', UninsPath) then begin |
| 29 | + Result := RemoveQuotes(UninsPath); |
| 30 | + end else if RegQueryStringValue(HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\Elixir_is1', 'UninstallString', UninsPath) then begin |
| 31 | + Result := RemoveQuotes(UninsPath); |
| 32 | + end; |
| 33 | +end; |
| 34 | +
|
| 35 | +function GetPreviousAppPath: String; |
| 36 | +begin |
| 37 | + Result := RemoveBackslashUnlessRoot(ExtractFilePath(GetPreviousUninsExe)); |
| 38 | +end; |
| 39 | +
|
| 40 | +function CheckPreviousVersionExists: Boolean; |
| 41 | +begin |
| 42 | + Result := (GetPreviousUninsExe <> ''); |
| 43 | +end; |
0 commit comments