diff --git a/Packages/D2007/X2Utils.dproj b/Packages/D2007/X2Utils.dproj
index ef3573e..b87d6d7 100644
--- a/Packages/D2007/X2Utils.dproj
+++ b/Packages/D2007/X2Utils.dproj
@@ -5,7 +5,7 @@
Debug
AnyCPU
DCC32
- ..\..\..\..\bin\D2007\X2Utils2007.bpl
+ ..\..\..\bpl\D2006\X2Utils2007.bpl
7.0
@@ -33,6 +33,16 @@
FalseTrueFalseX2UtilsTrueFalseTrue2007TrueFalse1000FalseFalseFalseFalseFalse104312521.0.0.01.0.0.0
+
+
+
+
+
+
+
+
+
+
Microsoft Office 2000 Sample Automation Server Wrapper Components
Microsoft Office XP Sample Automation Server Wrapper Components
@@ -42,12 +52,12 @@
MainSource
+
+
+
-
-
-
diff --git a/Resources/VistaManAsInvoker.RES b/Resources/VistaManAsInvoker.RES
new file mode 100644
index 0000000..00f7d3c
Binary files /dev/null and b/Resources/VistaManAsInvoker.RES differ
diff --git a/Resources/VistaManAsInvoker.manifest b/Resources/VistaManAsInvoker.manifest
new file mode 100644
index 0000000..3bfb23a
--- /dev/null
+++ b/Resources/VistaManAsInvoker.manifest
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Resources/VistaManAsInvoker.rc b/Resources/VistaManAsInvoker.rc
new file mode 100644
index 0000000..84e3810
--- /dev/null
+++ b/Resources/VistaManAsInvoker.rc
@@ -0,0 +1 @@
+1 24 "VistaManAsInvoker.manifest"
\ No newline at end of file
diff --git a/Resources/VistaManHighestAvailable.RES b/Resources/VistaManHighestAvailable.RES
new file mode 100644
index 0000000..025b93b
Binary files /dev/null and b/Resources/VistaManHighestAvailable.RES differ
diff --git a/Resources/VistaManHighestAvailable.manifest b/Resources/VistaManHighestAvailable.manifest
new file mode 100644
index 0000000..83e6304
--- /dev/null
+++ b/Resources/VistaManHighestAvailable.manifest
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Resources/VistaManHighestAvailable.rc b/Resources/VistaManHighestAvailable.rc
new file mode 100644
index 0000000..cdb56bf
--- /dev/null
+++ b/Resources/VistaManHighestAvailable.rc
@@ -0,0 +1 @@
+1 24 "VistaManHighestAvailable.manifest"
\ No newline at end of file
diff --git a/Resources/VistaManRequireAdministrator.RES b/Resources/VistaManRequireAdministrator.RES
new file mode 100644
index 0000000..c41377d
Binary files /dev/null and b/Resources/VistaManRequireAdministrator.RES differ
diff --git a/Resources/VistaManRequireAdministrator.manifest b/Resources/VistaManRequireAdministrator.manifest
new file mode 100644
index 0000000..cdc0c23
--- /dev/null
+++ b/Resources/VistaManRequireAdministrator.manifest
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Resources/VistaManRequireAdministrator.rc b/Resources/VistaManRequireAdministrator.rc
new file mode 100644
index 0000000..62394fc
--- /dev/null
+++ b/Resources/VistaManRequireAdministrator.rc
@@ -0,0 +1 @@
+1 24 "VistaManRequireAdministrator.manifest"
\ No newline at end of file
diff --git a/VistaManAsInvoker.pas b/VistaManAsInvoker.pas
new file mode 100644
index 0000000..d6e7e06
--- /dev/null
+++ b/VistaManAsInvoker.pas
@@ -0,0 +1,11 @@
+unit VistaManAsInvoker;
+
+{$WEAKPACKAGEUNIT ON}
+
+interface
+
+{$R 'Resources\VistaManAsInvoker.RES'}
+
+implementation
+end.
+
diff --git a/VistaManHighestAvailable.pas b/VistaManHighestAvailable.pas
new file mode 100644
index 0000000..8ab89f2
--- /dev/null
+++ b/VistaManHighestAvailable.pas
@@ -0,0 +1,11 @@
+unit VistaManHighestAvailable;
+
+{$WEAKPACKAGEUNIT ON}
+
+interface
+
+{$R 'Resources\VistaManHighestAvailable.RES'}
+
+implementation
+end.
+
diff --git a/VistaManRequireAdministrator.pas b/VistaManRequireAdministrator.pas
new file mode 100644
index 0000000..ef8b787
--- /dev/null
+++ b/VistaManRequireAdministrator.pas
@@ -0,0 +1,11 @@
+unit VistaManRequireAdministrator;
+
+{$WEAKPACKAGEUNIT ON}
+
+interface
+
+{$R 'Resources\VistaManRequireAdministrator.RES'}
+
+implementation
+end.
+
diff --git a/X2UtApp.pas b/X2UtApp.pas
index f9a0903..5406bcf 100644
--- a/X2UtApp.pas
+++ b/X2UtApp.pas
@@ -452,7 +452,7 @@ end;
function TX2App.FormatVersion(const ABuild: Boolean = True;
const AProductName: Boolean = False): String;
begin
- Result := FVersion.FormatVersion(ABuild, AProductName);
+ Result := Version.FormatVersion(ABuild, AProductName);
end;
diff --git a/X2UtSingleInstance.pas b/X2UtSingleInstance.pas
index f363501..c41ee7c 100644
--- a/X2UtSingleInstance.pas
+++ b/X2UtSingleInstance.pas
@@ -72,11 +72,13 @@ type
FFileMapData: PX2InstanceMapData;
FFileMapping: THandle;
FObservers: TInterfaceList;
+ FLocalIfGlobalFails: Boolean;
protected
function GetCount(): Integer; virtual;
+ procedure SetActive(const Value: Boolean); virtual;
procedure SetApplicationID(const Value: String); virtual;
procedure SetGlobal(const Value: Boolean); virtual;
- procedure SetActive(const Value: Boolean); virtual;
+ procedure SetLocalIfGlobalFails(const Value: Boolean); virtual;
procedure WindowProc(var Message: TMessage); virtual;
@@ -104,11 +106,12 @@ type
//:$ Unregisters a previously registered instance.
procedure Detach(const ANotifier: IX2InstanceObserver);
- property Active: Boolean read FActive write SetActive;
- property ApplicationID: String read FApplicationID write SetApplicationID;
- property FirstInstance: Boolean read FFirstInstance;
- property Global: Boolean read FGlobal write SetGlobal;
- property Count: Integer read GetCount;
+ property Active: Boolean read FActive write SetActive;
+ property ApplicationID: String read FApplicationID write SetApplicationID;
+ property FirstInstance: Boolean read FFirstInstance;
+ property Global: Boolean read FGlobal write SetGlobal;
+ property LocalIfGlobalFails: Boolean read FLocalIfGlobalFails write SetLocalIfGlobalFails;
+ property Count: Integer read GetCount;
end;
{
@@ -217,6 +220,7 @@ begin
inherited;
FObservers := TInterfaceList.Create;
+ FLocalIfGlobalFails := True;
end;
destructor TX2Instance.Destroy();
@@ -299,7 +303,15 @@ begin
PChar(ScopePrefix[Global] +
'SingleInstance.' + ApplicationID));
if FFileMapping = 0 then
- RaiseLastOSError();
+ begin
+ if Global and LocalIfGlobalFails then
+ begin
+ FGlobal := False;
+ Open();
+ Exit;
+ end else
+ RaiseLastOSError();
+ end;
FActive := True;
try
@@ -442,6 +454,11 @@ begin
end;
+procedure TX2Instance.SetLocalIfGlobalFails(const Value: Boolean);
+begin
+ FLocalIfGlobalFails := Value;
+end;
+
// Copied from System unit because Borland didn't make it public
function GetParamStr(P: PChar; var Param: String): PChar;