fix inno installer bugs
Originally committed to SVN as r747.
This commit is contained in:
parent
d0c0e2a318
commit
9c803be482
1 changed files with 16 additions and 9 deletions
|
@ -49,7 +49,7 @@ Compression=lzma/ultra
|
||||||
SolidCompression=yes
|
SolidCompression=yes
|
||||||
MinVersion=0,5
|
MinVersion=0,5
|
||||||
WizardImageFile=welcome.bmp
|
WizardImageFile=welcome.bmp
|
||||||
WizardSmallImageFile=aegisub2.bmp
|
WizardSmallImageFile=aegisub.bmp
|
||||||
|
|
||||||
[Languages]
|
[Languages]
|
||||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
|
@ -107,6 +107,7 @@ var
|
||||||
InstalledVersion: string;
|
InstalledVersion: string;
|
||||||
ReturnCode: Integer;
|
ReturnCode: Integer;
|
||||||
VersionMS, VersionLS: Cardinal;
|
VersionMS, VersionLS: Cardinal;
|
||||||
|
OverwriteInstall: Integer;
|
||||||
begin
|
begin
|
||||||
Result := GetVersionNumbers(AddBackslash(ExpandConstant('{sys}')) + 'avisynth.dll', VersionMS , VersionLS);
|
Result := GetVersionNumbers(AddBackslash(ExpandConstant('{sys}')) + 'avisynth.dll', VersionMS , VersionLS);
|
||||||
if Result then
|
if Result then
|
||||||
|
@ -122,9 +123,15 @@ begin
|
||||||
|
|
||||||
if RegQueryStringValue(HKLM, 'SOFTWARE\Aegisub\info', 'InstallDir', InstallDir) and RegQueryStringValue(HKLM, 'SOFTWARE\Aegisub\info', 'InstVer', InstalledVersion) and FileExists(AddBackslash(InstallDir) + 'uninstall.exe') then
|
if RegQueryStringValue(HKLM, 'SOFTWARE\Aegisub\info', 'InstallDir', InstallDir) and RegQueryStringValue(HKLM, 'SOFTWARE\Aegisub\info', 'InstVer', InstalledVersion) and FileExists(AddBackslash(InstallDir) + 'uninstall.exe') then
|
||||||
begin
|
begin
|
||||||
if not MsgBox('A previous Aegisub install has been detected (Version ' + InstalledVersion + ').'#13#10'Due to changes from the old installer you are strongly encouraged to uninstall it first?', mbConfirmation, MB_YESNO) = IDYES then
|
OverwriteInstall := MsgBox('A previous Aegisub install has been detected (Version ' + InstalledVersion + ').'#13#10'Due to changes from the old installer you are strongly encouraged to uninstall it first.'#13#10'Uninstall it before proceeding?', mbConfirmation, MB_YESNOCANCEL);
|
||||||
|
if OverwriteInstall = IDCANCEL then
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
Exit;
|
Exit;
|
||||||
|
end
|
||||||
|
else if OverwriteInstall = IDNO then
|
||||||
|
Exit
|
||||||
|
else if OverwriteInstall = IDYES then
|
||||||
if FileCopy(AddBackslash(InstallDir) + 'uninstall.exe', AddBackslash(ExpandConstant('{tmp}')) + 'aegisub-uninstall.exe', False) then
|
if FileCopy(AddBackslash(InstallDir) + 'uninstall.exe', AddBackslash(ExpandConstant('{tmp}')) + 'aegisub-uninstall.exe', False) then
|
||||||
begin
|
begin
|
||||||
Exec(AddBackslash(ExpandConstant('{tmp}')) + 'aegisub-uninstall.exe', '_?=' + InstallDir, InstallDir, SW_SHOW, ewWaitUntilTerminated, ReturnCode);
|
Exec(AddBackslash(ExpandConstant('{tmp}')) + 'aegisub-uninstall.exe', '_?=' + InstallDir, InstallDir, SW_SHOW, ewWaitUntilTerminated, ReturnCode);
|
||||||
|
@ -141,7 +148,7 @@ begin
|
||||||
case CurStep of
|
case CurStep of
|
||||||
ssInstall:
|
ssInstall:
|
||||||
begin
|
begin
|
||||||
//uninstall previous version for upgrades if sdame dir was selected
|
//uninstall previous version for upgrades if same dir was selected
|
||||||
if RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\Aegisub_is1', 'UninstallString', UninstallString) then
|
if RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\Aegisub_is1', 'UninstallString', UninstallString) then
|
||||||
if AddBackslash(ExtractFilePath(RemoveQuotes(UninstallString))) = AddBackslash(ExpandConstant('{app}')) then
|
if AddBackslash(ExtractFilePath(RemoveQuotes(UninstallString))) = AddBackslash(ExpandConstant('{app}')) then
|
||||||
Exec(RemoveQuotes(UninstallString), '/VERYSILENT /NORESTART', '', SW_SHOW, ewWaitUntilTerminated, ReturnCode);
|
Exec(RemoveQuotes(UninstallString), '/VERYSILENT /NORESTART', '', SW_SHOW, ewWaitUntilTerminated, ReturnCode);
|
||||||
|
|
Loading…
Reference in a new issue