Skip to content
This repository has been archived by the owner on Aug 12, 2018. It is now read-only.

Commit

Permalink
installer: switch to using Inno Setup's CloseApplications directive.
Browse files Browse the repository at this point in the history
Now the installer will not perform a check when it starts for running process(es). Instead, it will warn just before the actual installation and offer to close any running process(es).

See also http://www.jrsoftware.org/ishelp/index.php?topic=setup_closeapplications and http://www.jrsoftware.org/ishelp/index.php?topic=setupcmdline
  • Loading branch information
XhmikosR committed Sep 30, 2014
1 parent d9c20d3 commit e4f7485
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 29 deletions.
27 changes: 1 addition & 26 deletions distrib/notepad2_setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ ArchitecturesInstallIn64BitMode=x64
#ifexist "..\signinfo_notepad2-mod.txt"
SignTool=MySignTool
#endif
CloseApplications=true


[Languages]
Expand Down Expand Up @@ -149,7 +150,6 @@ Name: remove_default; Description: {cm:tsk_RemoveDefault}; GroupDescript


[Files]
Source: psvince.dll; DestDir: {app}; Flags: ignoreversion
Source: {#bindir}\Release_x64\Notepad2.exe; DestDir: {app}; Flags: ignoreversion; Check: Is64BitInstallMode()
Source: {#bindir}\Release_x86\Notepad2.exe; DestDir: {app}; Flags: ignoreversion; Check: not Is64BitInstallMode()
Source: ..\License.txt; DestDir: {app}; Flags: ignoreversion
Expand Down Expand Up @@ -192,12 +192,6 @@ const
installer_mutex = '{#app_name}' + '_setup_mutex';
IFEO = 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe';
function IsModuleLoaded(modulename: AnsiString): Boolean;
external 'IsModuleLoaded2@files:psvince.dll stdcall setuponly';
function IsModuleLoadedU(modulename: AnsiString): Boolean;
external 'IsModuleLoaded2@{app}\psvince.dll stdcall uninstallonly';
#if defined(sse_required) || defined(sse2_required)
function IsProcessorFeaturePresent(Feature: Integer): Boolean;
external '[email protected] stdcall';
Expand Down Expand Up @@ -405,8 +399,6 @@ end;
function InitializeSetup(): Boolean;
var
iMsgBoxResult: Integer;
begin
// Create a mutex for the installer and if it's already running then show a message and stop installation
if CheckForMutexes(installer_mutex) and not WizardSilent() then begin
Expand All @@ -417,12 +409,6 @@ begin
Result := True;
CreateMutex(installer_mutex);
while IsModuleLoaded('Notepad2.exe') and (iMsgBoxResult <> IDCANCEL) do
iMsgBoxResult := SuppressibleMsgBox(CustomMessage('msg_AppIsRunning'), mbError, MB_OKCANCEL, IDCANCEL);
if iMsgBoxResult = IDCANCEL then
Result := False;
#if defined(sse2_required)
if not IsSSE2Supported() then begin
SuppressibleMsgBox(CustomMessage('msg_simd_sse2'), mbCriticalError, MB_OK, MB_OK);
Expand All @@ -440,8 +426,6 @@ end;
function InitializeUninstall(): Boolean;
var
iMsgBoxResult: Integer;
begin
if CheckForMutexes(installer_mutex) then begin
SuppressibleMsgBox(CustomMessage('msg_SetupIsRunningWarning'), mbError, MB_OK, MB_OK);
Expand All @@ -451,14 +435,5 @@ begin
Result := True;
CreateMutex(installer_mutex);
// Check if Notepad2 is running during uninstallation
while IsModuleLoadedU('Notepad2.exe') and (iMsgBoxResult <> IDCANCEL) do
iMsgBoxResult := SuppressibleMsgBox(CustomMessage('msg_AppIsRunningUninstall'), mbError, MB_OKCANCEL, IDCANCEL);
if iMsgBoxResult = IDCANCEL then
Result := False;
// Unload psvince.dll in order to be uninstalled
UnloadDLL(ExpandConstant('{app}\psvince.dll'));
end;
end;
Binary file removed distrib/psvince.dll
Binary file not shown.
4 changes: 1 addition & 3 deletions distrib/todo.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
1) Implement a mutex in Notepad2 and use that to check if it's running
(a working patch would be really welcome)
2) Use RegQueryStringValue to get the uninstall command for the other versions.
1) Use RegQueryStringValue to get the uninstall command for the other versions.
I need to trim down the command in order to use it.

0 comments on commit e4f7485

Please sign in to comment.