← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~smpettit/openlp/innosetup into lp:openlp

 

Stevan Pettit has proposed merging lp:~smpettit/openlp/innosetup into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~smpettit/openlp/innosetup/+merge/61995

Modified OpenLP-2.0.iss to check if OpenLP is currently running prior to an install.  If OpenLP is running, the user must close it or cancel the install.

This check required the addition of psvince.dll (obtained from http://www.vincenzo.net/isxkb/index.php?title=PSVince).

The dll is included in the build, but is not copied to the users machine.

I tried to use the Inno setup function "FindWindowByWindowName", but this fails if the OpenLP session has a "Service" new/open 
-- 
https://code.launchpad.net/~smpettit/openlp/innosetup/+merge/61995
Your team OpenLP Core is requested to review the proposed merge of lp:~smpettit/openlp/innosetup into lp:openlp.
=== modified file 'resources/windows/OpenLP-2.0.iss'
--- resources/windows/OpenLP-2.0.iss	2011-05-21 22:16:28 +0000
+++ resources/windows/OpenLP-2.0.iss	2011-05-23 16:07:42 +0000
@@ -65,6 +65,7 @@
 
 [Files]
 Source: ..\..\dist\OpenLP\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
+Source: psvince.dll; Flags: dontcopy
 ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
 
 [Icons]
@@ -86,6 +87,9 @@
 Root: HKCR; Subkey: "OpenLP\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\OpenLP.exe"" ""%1"""
 
 [Code]
+function IsModuleLoaded(modulename: String ):  Boolean;
+external 'IsModuleLoaded@files:psvince.dll stdcall';
+
 function GetUninstallString(): String;
 var
   sUnInstPath: String;
@@ -126,6 +130,19 @@
     Result := 1;
 end;
 
+function InitializeSetup(): Boolean;
+begin
+  Result := true;
+  while IsModuleLoaded( 'OpenLP.exe' ) and Result do
+  begin
+    if MsgBox( 'Openlp is currently running, please close it to continue the install.',
+      mbError, MB_OKCANCEL ) =  IDCANCEL then
+	begin
+	  Result := false;
+	end;
+  end;
+end;
+
 procedure CurStepChanged(CurStep: TSetupStep);
 begin
   if (CurStep=ssInstall) then

=== added file 'resources/windows/psvince.dll'
Binary files resources/windows/psvince.dll	1970-01-01 00:00:00 +0000 and resources/windows/psvince.dll	2011-05-23 16:07:42 +0000 differ
=== modified file 'scripts/windows-builder.py'
--- scripts/windows-builder.py	2011-05-13 11:45:41 +0000
+++ scripts/windows-builder.py	2011-05-23 16:07:42 +0000
@@ -225,6 +225,8 @@
         os.path.join(dist_path, u'OpenLP.ico'))
     copy(os.path.join(winres_path, u'LICENSE.txt'),
         os.path.join(dist_path, u'LICENSE.txt'))
+    copy(os.path.join(winres_path, u'psvince.dll'),
+        os.path.join(dist_path, u'psvince.dll'))
     if os.path.isfile(os.path.join(helpfile_path, u'Openlp.chm')):
         print u'        Windows help file found'
         copy(os.path.join(helpfile_path, u'Openlp.chm'),


Follow ups