mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 14:32:35 +01:00
installer:
* use SuppressibleMsgBox * internal cleanup (please confirm that everything works fine i.e. the .NET detection etc) git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@682 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
29cd0863c8
commit
084c10107f
@ -26,7 +26,7 @@
|
|||||||
#error Update your Inno Setup version
|
#error Update your Inno Setup version
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define installer_build_number "19"
|
#define installer_build_number "20"
|
||||||
|
|
||||||
#define app_copyright "Copyright © 2001-2011, Nikse"
|
#define app_copyright "Copyright © 2001-2011, Nikse"
|
||||||
#define VerMajor
|
#define VerMajor
|
||||||
@ -403,7 +403,7 @@ begin
|
|||||||
// based on whether these files exist only
|
// based on whether these files exist only
|
||||||
if CurUninstallStep = usUninstall then begin
|
if CurUninstallStep = usUninstall then begin
|
||||||
if SettingsExistCheck OR DictionariesExistCheck then begin
|
if SettingsExistCheck OR DictionariesExistCheck then begin
|
||||||
if MsgBox(ExpandConstant('{cm:msg_DeleteSettings}'), mbConfirmation, MB_YESNO OR MB_DEFBUTTON2) = IDYES then begin
|
if SuppressibleMsgBox(ExpandConstant('{cm:msg_DeleteSettings}'), mbConfirmation, MB_YESNO OR MB_DEFBUTTON2, IDNO) = IDYES then begin
|
||||||
CleanUpDictionaries;
|
CleanUpDictionaries;
|
||||||
DeleteFile(ExpandConstant('{userappdata}\Subtitle Edit\Settings.xml'));
|
DeleteFile(ExpandConstant('{userappdata}\Subtitle Edit\Settings.xml'));
|
||||||
end;
|
end;
|
||||||
@ -432,36 +432,32 @@ var
|
|||||||
begin
|
begin
|
||||||
// Create a mutex for the installer and if it's already running then expose a message and stop installation
|
// Create a mutex for the installer and if it's already running then expose a message and stop installation
|
||||||
if CheckForMutexes(installer_mutex_name) AND NOT WizardSilent() then begin
|
if CheckForMutexes(installer_mutex_name) AND NOT WizardSilent() then begin
|
||||||
MsgBox(ExpandConstant('{cm:msg_SetupIsRunningWarning}'), mbError, MB_OK);
|
SuppressibleMsgBox(ExpandConstant('{cm:msg_SetupIsRunningWarning}'), mbError, MB_OK, MB_OK);
|
||||||
exit;
|
Result := False;
|
||||||
end;
|
end else begin
|
||||||
|
Result := True;
|
||||||
CreateMutex(installer_mutex_name);
|
CreateMutex(installer_mutex_name);
|
||||||
|
|
||||||
if IsModuleLoaded('SubtitleEdit.exe') then begin
|
if IsModuleLoaded('SubtitleEdit.exe') then begin
|
||||||
MsgBox(ExpandConstant('{cm:msg_AppIsRunning}'), mbError, MB_OK );
|
SuppressibleMsgBox(ExpandConstant('{cm:msg_AppIsRunning}'), mbError, MB_OK, MB_OK);
|
||||||
Result := False;
|
Result := False;
|
||||||
Abort;
|
|
||||||
end else
|
end else
|
||||||
Result := True;
|
|
||||||
|
|
||||||
// Check if .NET Framework 2.0 is installed and if not offer to download it
|
// Check if .NET Framework 2.0 is installed and if not offer to download it
|
||||||
try
|
try
|
||||||
ExpandConstant('{dotnet20}');
|
ExpandConstant('{dotnet20}');
|
||||||
Result := True;
|
|
||||||
except
|
except
|
||||||
begin
|
begin
|
||||||
if NOT WizardSilent() then
|
if NOT WizardSilent() then
|
||||||
if MsgBox(ExpandConstant('{cm:msg_AskToDownNET}'), mbCriticalError, MB_YESNO OR MB_DEFBUTTON1) = IDYES then begin
|
if SuppressibleMsgBox(ExpandConstant('{cm:msg_AskToDownNET}'), mbCriticalError, MB_YESNO OR MB_DEFBUTTON1, IDYES) = IDYES then begin
|
||||||
Result := False;
|
|
||||||
ShellExec('open','http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe','','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
|
ShellExec('open','http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe','','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
|
||||||
|
Result := False;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
is_update := RegKeyExists(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SubtitleEdit_is1');
|
is_update := RegKeyExists(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SubtitleEdit_is1');
|
||||||
|
|
||||||
end;
|
end;
|
||||||
@ -471,19 +467,16 @@ function InitializeUninstall(): Boolean;
|
|||||||
begin
|
begin
|
||||||
// Check if app is running during uninstallation
|
// Check if app is running during uninstallation
|
||||||
if IsModuleLoadedU('SubtitleEdit.exe') then begin
|
if IsModuleLoadedU('SubtitleEdit.exe') then begin
|
||||||
MsgBox(ExpandConstant('{cm:msg_AppIsRunning}'), mbError, MB_OK );
|
SuppressibleMsgBox(ExpandConstant('{cm:msg_AppIsRunning}'), mbError, MB_OK, MB_OK);
|
||||||
Result := False;
|
Result := False;
|
||||||
end else
|
end else
|
||||||
Result := True;
|
Result := True;
|
||||||
|
|
||||||
if NOT IsModuleLoadedU('SubtitleEdit.exe') AND CheckForMutexes(installer_mutex_name) then begin
|
if NOT IsModuleLoadedU('SubtitleEdit.exe') AND CheckForMutexes(installer_mutex_name) then begin
|
||||||
MsgBox(ExpandConstant('{cm:msg_SetupIsRunningWarning}'), mbError, MB_OK);
|
SuppressibleMsgBox(ExpandConstant('{cm:msg_SetupIsRunningWarning}'), mbError, MB_OK, MB_OK);
|
||||||
Result := False;
|
Result := False;
|
||||||
end
|
end else
|
||||||
else begin
|
|
||||||
CreateMutex(installer_mutex_name);
|
CreateMutex(installer_mutex_name);
|
||||||
Result := True;
|
|
||||||
end;
|
|
||||||
|
|
||||||
// Unload the psvince.dll in order to be uninstalled
|
// Unload the psvince.dll in order to be uninstalled
|
||||||
UnloadDLL(ExpandConstant('{app}\psvince.dll'));
|
UnloadDLL(ExpandConstant('{app}\psvince.dll'));
|
||||||
|
Loading…
Reference in New Issue
Block a user