Updated registration for restart manager to push null for app params (c++ dll import...
authorGeorge Pantazis <gpant@noc.grnet.gr>
Thu, 21 Jun 2012 14:35:46 +0000 (17:35 +0300)
committerGeorge Pantazis <gpant@noc.grnet.gr>
Thu, 21 Jun 2012 14:35:46 +0000 (17:35 +0300)
Updated inno installer configuration for RM handling to include gpant commits.
Added logging for RM registration (fails silently on anything before VISTA)

Signed-off-by: George Pantazis <gpant@noc.grnet.gr>

trunk/Pithos.Client.WPF/App.xaml.cs
trunk/Pithos.Client.WPF/Properties/AssemblyInfo.cs
trunk/Pithos.Core/Agents/PollAgent.cs
trunk/Pithos.Installer/PithosPlus.iss
trunk/Pithos.Installer/PithosPlus.~is

index ff61f87..e72e217 100644 (file)
@@ -70,7 +70,7 @@ namespace Pithos.Client.WPF
         
             ///DLL Import to add restart manager support
             [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
-            static extern uint RegisterApplicationRestart(string pwzCommandLine, RestartFlags dwFlags);
+            public static extern Int32 RegisterApplicationRestart(String commandLineArgs, UInt32 flags);
                
         public App()
         {
@@ -79,8 +79,8 @@ namespace Pithos.Client.WPF
             InitializeLogging();
 
             ///Register Application in the Restartmanager service
-            RegisterApplicationRestart("Upgrade", RestartFlags.NONE);
-
+            Int32 result = RegisterApplicationRestart(null, 0);
+            Log.ErrorFormat("RM Result:", result);
 
             DispatcherUnhandledException += OnDispatcherUnhandledException;
             AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
index 3cdc2ab..01f0e87 100644 (file)
@@ -93,5 +93,5 @@ using System.Windows;
 // You can specify all the values or you can default the Build and Revision Numbers 
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.7.20619.3")]
-[assembly: AssemblyFileVersionAttribute("0.7.20619.3")]
+[assembly: AssemblyVersion("0.7.20621.2")]
+[assembly: AssemblyFileVersionAttribute("0.7.20621.2")]
index e304b1e..a669d24 100644 (file)
@@ -411,7 +411,7 @@ namespace Pithos.Core.Agents
                 }\r
                 catch (Exception ex)\r
                 {\r
-                    Log.ErrorFormat("[FAIL] ListObjects for{0} in ProcessRemoteFiles with {1}", accountInfo.UserName, ex);\r
+                    Log.ErrorFormat("[FAIL] ListObjects for {0} in ProcessRemoteFiles with {1}", accountInfo.UserName, ex);\r
                     return nextSince;\r
                 }\r
 \r
index 30f7e23..5822213 100644 (file)
@@ -54,9 +54,11 @@ UninstallLogMode=append
 VersionInfoCompany=GRNET\r
 VersionInfoDescription=Pithos Plus\r
 VersionInfoCopyright=(c) 2011-2012 GRNET\r
-VersionInfoProductName=Pitho Plus\r
+VersionInfoProductName=Pithos Plus\r
 VersionInfoProductVersion=1\r
 AppModifyPath="{app}\UninsHs.exe" /m0=AppId\r
+CloseApplications=yes\r
+RestartApplications=yes\r
 \r
 [Languages]\r
 Name: "english"; MessagesFile: "compiler:Default.isl"\r
@@ -79,12 +81,12 @@ Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescrip
 Source: "..\Pithos.Client.WPF\bin\Debug\PithosPlus.exe"; DestDir: {app}; Flags: restartreplace ignoreversion; Components: RequiredFiles; Languages: english french german spanish greek\r
 Source: "..\Pithos.Client.WPF\bin\Debug\PithosPlus.exe.config"; DestDir: {app}; Flags: restartreplace ignoreversion; Components: RequiredFiles; Languages: english french german spanish greek\r
 ; Appearance\r
-Source: "Skin\ISSkin.dll"; DestDir: {app}; Flags: dontcopy\r
-Source: "Skin\GRNETWhite.cjstyles"; DestDir: {tmp}; Flags: dontcopy\r
+;Source: "Skin\ISSkin.dll"; DestDir: {app}; Flags: dontcopy\r
+;Source: "Skin\GRNETWhite.cjstyles"; DestDir: {tmp}; Flags: dontcopy\r
 ; Repair/Modify\r
 Source: "Tools\UninsHs.exe"; DestDir: {app}; Flags: restartreplace\r
 ; Running Processes\r
-Source: "Tools\IssProc.dll"; DestDir: {app}; Flags: restartreplace\r
+;Source: "Tools\IssProc.dll"; DestDir: {app}; Flags: restartreplace\r
 ; DLL\r
 Source: "..\Pithos.ShellExtensions\bin\x86\Debug\Pithos.ShellExtensions.dll"; DestDir: {app}; Flags: restartreplace ignoreversion; Components: RequiredFiles; Languages: english french german spanish greek; Check: not Is64BitInstallMode\r
 Source: "..\Pithos.ShellExtensions\bin\x64\Debug\Pithos.ShellExtensions.dll"; DestDir: {app}; Flags: restartreplace ignoreversion; Components: RequiredFiles; Languages: english french german spanish greek; Check: Is64BitInstallMode\r
@@ -313,34 +315,34 @@ dotNET40Missing: Boolean;
         LicenseID: Integer;      \r
 \r
 // IssFindModule called on in/uninstall\r
-function IssFindModule(hWnd: Integer; Modulename: String; Language: PAnsiChar; Silent: Boolean; CanIgnore: Boolean ): Integer;\r
-external 'IssFindModuleW@files:IssProc.dll stdcall setuponly';\r
+///function IssFindModule(hWnd: Integer; Modulename: String; Language: PAnsiChar; Silent: Boolean; CanIgnore: Boolean ): Integer;\r
+///external 'IssFindModuleW@files:IssProc.dll stdcall setuponly';\r
 \r
-function IssFindModuleU(hWnd: Integer; Modulename: String; Language: PAnsiChar; Silent: Boolean; CanIgnore: Boolean ): Integer;\r
-external 'IssFindModuleW@{app}\IssProc.dll stdcall uninstallonly';\r
+///function IssFindModuleU(hWnd: Integer; Modulename: String; Language: PAnsiChar; Silent: Boolean; CanIgnore: Boolean ): Integer;\r
+///external 'IssFindModuleW@{app}\IssProc.dll stdcall uninstallonly';\r
 \r
 //Call this to enable search for any in use file type\r
-function IssEnableAnyFileInUseCheck(Folder: String): Integer;\r
-external 'IssEnableAnyFileInUseCheckW@files:IssProc.dll stdcall setuponly';\r
+///function IssEnableAnyFileInUseCheck(Folder: String): Integer;\r
+///external 'IssEnableAnyFileInUseCheckW@files:IssProc.dll stdcall setuponly';\r
 \r
 //IssEnableAnyFileInUseCheck called on uninstall\r
-function IssEnableAnyFileInUseCheckU(Folder: String): Integer;\r
-external 'IssEnableAnyFileInUseCheckW@{app}\IssProc.dll stdcall uninstallonly';\r
+///function IssEnableAnyFileInUseCheckU(Folder: String): Integer;\r
+///external 'IssEnableAnyFileInUseCheckW@{app}\IssProc.dll stdcall uninstallonly';\r
 \r
 //Register for commercial use on install\r
-function IssRegister(rName: PAnsiChar; rKey: PAnsiChar): Integer;\r
-external 'IssRegister@files:IssProc.dll stdcall setuponly';\r
+///function IssRegister(rName: PAnsiChar; rKey: PAnsiChar): Integer;\r
+///external 'IssRegister@files:IssProc.dll stdcall setuponly';\r
 \r
 //Register for commercial use on uninstall\r
-function IssRegisterU(rName: PAnsiChar; rKey: PAnsiChar): Integer;\r
-external 'IssRegister@{app}\IssProc.dll stdcall uninstallonly';\r
+///function IssRegisterU(rName: PAnsiChar; rKey: PAnsiChar): Integer;\r
+///external 'IssRegister@{app}\IssProc.dll stdcall uninstallonly';\r
 \r
 // Importing LoadSkin API from ISSkin.DLL\r
-procedure LoadSkin(lpszPath: String; lpszIniFileName: String);\r
-external 'LoadSkin@files:isskin.dll stdcall';\r
+//procedure LoadSkin(lpszPath: String; lpszIniFileName: String);\r
+//external 'LoadSkin@files:isskin.dll stdcall';\r
 \r
-procedure UnloadSkin();\r
-external 'UnloadSkin@files:isskin.dll stdcall';\r
+//procedure UnloadSkin();\r
+//external 'UnloadSkin@files:isskin.dll stdcall';\r
 \r
 // Importing ShowWindow Windows API from User32.DLL\r
 function ShowWindow(hWnd: Integer; uType: Integer): Integer;\r
@@ -392,9 +394,9 @@ begin
       Result := false;\r
             \r
       hWnd := StrToInt(ExpandConstant('{wizardhwnd}'));                     { get main wizard handle }\r
-      IssEnableAnyFileInUseCheck(ExpandConstant('{app}'));\r
-      sModuleName :=ExpandConstant('pithos*.dll;PithosPlus.exe');            \r
-      nCode:=IssFindModule(hWnd,sModuleName,'en',false,true);                { search for module and display files-in-use window if found  }\r
+///      IssEnableAnyFileInUseCheck(ExpandConstant('{app}'));\r
+///      sModuleName :=ExpandConstant('pithos*.dll;PithosPlus.exe');            \r
+///      nCode:=IssFindModule(hWnd,sModuleName,'en',false,true);                { search for module and display files-in-use window if found  }\r
      if nCode=1 then  begin                                                 { cancel pressed or files-in-use window closed }\r
           PostMessage (WizardForm.Handle, $0010, 0, 0);                     { quit setup, $0010=WM_CLOSE }\r
      end else if (nCode=0) or (nCode=2) then begin                          { no module found or ignored pressed}\r
@@ -406,8 +408,8 @@ end;
 function InitializeSetup(): Boolean;\r
 begin\r
   //Unpack The Skin\r
-  ExtractTemporaryFile('GRNETWhite.cjstyles');\r
-  LoadSkin(ExpandConstant('{tmp}\GRNETWhite.cjstyles'), '');\r
+ //ExtractTemporaryFile('GRNETWhite.cjstyles');\r
+ //LoadSkin(ExpandConstant('{tmp}\GRNETWhite.cjstyles'), '');\r
     \r
   // Test the presence of .NET 4.0\r
   if (not(RegKeyExists(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4'))) then\r
@@ -419,8 +421,8 @@ end;
 procedure DeinitializeSetup();\r
 begin\r
   //Hide Window widget\r
-  ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);\r
-  UnloadSkin();\r
+  //ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);\r
+  //UnloadSkin();\r
 end;\r
 \r
 function ShouldInstalldotNET40(): Boolean;\r
index eaeb87b..ea8d032 100644 (file)
@@ -54,9 +54,11 @@ UninstallLogMode=append
 VersionInfoCompany=GRNET
 VersionInfoDescription=Pithos Plus
 VersionInfoCopyright=(c) 2011-2012 GRNET
-VersionInfoProductName=Pitho Plus
+VersionInfoProductName=Pithos Plus
 VersionInfoProductVersion=1
 AppModifyPath="{app}\UninsHs.exe" /m0=AppId
+;CloseApplications=yes
+RestartApplications=yes
 
 [Languages]
 Name: "english"; MessagesFile: "compiler:Default.isl"
@@ -79,12 +81,12 @@ Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescrip
 Source: "..\Pithos.Client.WPF\bin\Debug\PithosPlus.exe"; DestDir: {app}; Flags: restartreplace ignoreversion; Components: RequiredFiles; Languages: english french german spanish greek
 Source: "..\Pithos.Client.WPF\bin\Debug\PithosPlus.exe.config"; DestDir: {app}; Flags: restartreplace ignoreversion; Components: RequiredFiles; Languages: english french german spanish greek
 ; Appearance
-Source: "Skin\ISSkin.dll"; DestDir: {app}; Flags: dontcopy
-Source: "Skin\GRNETWhite.cjstyles"; DestDir: {tmp}; Flags: dontcopy
+;Source: "Skin\ISSkin.dll"; DestDir: {app}; Flags: dontcopy
+;Source: "Skin\GRNETWhite.cjstyles"; DestDir: {tmp}; Flags: dontcopy
 ; Repair/Modify
 Source: "Tools\UninsHs.exe"; DestDir: {app}; Flags: restartreplace
 ; Running Processes
-Source: "Tools\IssProc.dll"; DestDir: {app}; Flags: restartreplace
+;Source: "Tools\IssProc.dll"; DestDir: {app}; Flags: restartreplace
 ; DLL
 Source: "..\Pithos.ShellExtensions\bin\x86\Debug\Pithos.ShellExtensions.dll"; DestDir: {app}; Flags: restartreplace ignoreversion; Components: RequiredFiles; Languages: english french german spanish greek; Check: not Is64BitInstallMode
 Source: "..\Pithos.ShellExtensions\bin\x64\Debug\Pithos.ShellExtensions.dll"; DestDir: {app}; Flags: restartreplace ignoreversion; Components: RequiredFiles; Languages: english french german spanish greek; Check: Is64BitInstallMode
@@ -100,7 +102,6 @@ Source: "..\Pithos.Client.WPF\bin\Debug\log4net.dll"; DestDir: {app}; Flags: res
 Source: "..\Pithos.Client.WPF\bin\Debug\Newtonsoft.Json.dll"; DestDir: {app}; Flags: restartreplace ignoreversion; Components: RequiredFiles; Languages: english french german spanish greek
 Source: "..\Pithos.Client.WPF\bin\Debug\NHibernate.ByteCode.Castle.dll"; DestDir: {app}; Flags: restartreplace ignoreversion; Components: RequiredFiles; Languages: english french german spanish greek
 Source: "..\Pithos.Client.WPF\bin\Debug\NHibernate.dll"; DestDir: {app}; Flags: restartreplace ignoreversion; Components: RequiredFiles; Languages: english french german spanish greek
-Source: "..\Pithos.Client.WPF\bin\Debug\NHibernate.Search.dll"; DestDir: {app}; Flags: restartreplace ignoreversion; Components: RequiredFiles; Languages: english french german spanish greek
 Source: "..\Pithos.Client.WPF\bin\Debug\ParallelExtensionsExtras.dll"; DestDir: {app}; Flags: restartreplace ignoreversion; Components: RequiredFiles; Languages: english french german spanish greek
 Source: "..\Pithos.Client.WPF\bin\Debug\Pithos.Core.dll"; DestDir: {app}; Flags: restartreplace ignoreversion; Components: RequiredFiles; Languages: english french german spanish greek
 Source: "..\Pithos.Client.WPF\bin\Debug\Pithos.Interfaces.dll"; DestDir: {app}; Flags: restartreplace ignoreversion; Components: RequiredFiles; Languages: english french german spanish greek
@@ -314,34 +315,34 @@ dotNET40Missing: Boolean;
         LicenseID: Integer;      
 
 // IssFindModule called on in/uninstall
-function IssFindModule(hWnd: Integer; Modulename: String; Language: PAnsiChar; Silent: Boolean; CanIgnore: Boolean ): Integer;
-external 'IssFindModuleW@files:IssProc.dll stdcall setuponly';
+///function IssFindModule(hWnd: Integer; Modulename: String; Language: PAnsiChar; Silent: Boolean; CanIgnore: Boolean ): Integer;
+///external 'IssFindModuleW@files:IssProc.dll stdcall setuponly';
 
-function IssFindModuleU(hWnd: Integer; Modulename: String; Language: PAnsiChar; Silent: Boolean; CanIgnore: Boolean ): Integer;
-external 'IssFindModuleW@{app}\IssProc.dll stdcall uninstallonly';
+///function IssFindModuleU(hWnd: Integer; Modulename: String; Language: PAnsiChar; Silent: Boolean; CanIgnore: Boolean ): Integer;
+///external 'IssFindModuleW@{app}\IssProc.dll stdcall uninstallonly';
 
 //Call this to enable search for any in use file type
-function IssEnableAnyFileInUseCheck(Folder: String): Integer;
-external 'IssEnableAnyFileInUseCheckW@files:IssProc.dll stdcall setuponly';
+///function IssEnableAnyFileInUseCheck(Folder: String): Integer;
+///external 'IssEnableAnyFileInUseCheckW@files:IssProc.dll stdcall setuponly';
 
 //IssEnableAnyFileInUseCheck called on uninstall
-function IssEnableAnyFileInUseCheckU(Folder: String): Integer;
-external 'IssEnableAnyFileInUseCheckW@{app}\IssProc.dll stdcall uninstallonly';
+///function IssEnableAnyFileInUseCheckU(Folder: String): Integer;
+///external 'IssEnableAnyFileInUseCheckW@{app}\IssProc.dll stdcall uninstallonly';
 
 //Register for commercial use on install
-function IssRegister(rName: PAnsiChar; rKey: PAnsiChar): Integer;
-external 'IssRegister@files:IssProc.dll stdcall setuponly';
+///function IssRegister(rName: PAnsiChar; rKey: PAnsiChar): Integer;
+///external 'IssRegister@files:IssProc.dll stdcall setuponly';
 
 //Register for commercial use on uninstall
-function IssRegisterU(rName: PAnsiChar; rKey: PAnsiChar): Integer;
-external 'IssRegister@{app}\IssProc.dll stdcall uninstallonly';
+///function IssRegisterU(rName: PAnsiChar; rKey: PAnsiChar): Integer;
+///external 'IssRegister@{app}\IssProc.dll stdcall uninstallonly';
 
 // Importing LoadSkin API from ISSkin.DLL
-procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
-external 'LoadSkin@files:isskin.dll stdcall';
+//procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
+//external 'LoadSkin@files:isskin.dll stdcall';
 
-procedure UnloadSkin();
-external 'UnloadSkin@files:isskin.dll stdcall';
+//procedure UnloadSkin();
+//external 'UnloadSkin@files:isskin.dll stdcall';
 
 // Importing ShowWindow Windows API from User32.DLL
 function ShowWindow(hWnd: Integer; uType: Integer): Integer;
@@ -393,9 +394,9 @@ begin
       Result := false;
             
       hWnd := StrToInt(ExpandConstant('{wizardhwnd}'));                     { get main wizard handle }
-      IssEnableAnyFileInUseCheck(ExpandConstant('{app}'));
-      sModuleName :=ExpandConstant('pithos*.dll;PithosPlus.exe');            
-      nCode:=IssFindModule(hWnd,sModuleName,'en',false,true);                { search for module and display files-in-use window if found  }
+///      IssEnableAnyFileInUseCheck(ExpandConstant('{app}'));
+///      sModuleName :=ExpandConstant('pithos*.dll;PithosPlus.exe');            
+///      nCode:=IssFindModule(hWnd,sModuleName,'en',false,true);                { search for module and display files-in-use window if found  }
      if nCode=1 then  begin                                                 { cancel pressed or files-in-use window closed }
           PostMessage (WizardForm.Handle, $0010, 0, 0);                     { quit setup, $0010=WM_CLOSE }
      end else if (nCode=0) or (nCode=2) then begin                          { no module found or ignored pressed}
@@ -407,8 +408,8 @@ end;
 function InitializeSetup(): Boolean;
 begin
   //Unpack The Skin
-  ExtractTemporaryFile('GRNETWhite.cjstyles');
-  LoadSkin(ExpandConstant('{tmp}\GRNETWhite.cjstyles'), '');
+ //ExtractTemporaryFile('GRNETWhite.cjstyles');
+ //LoadSkin(ExpandConstant('{tmp}\GRNETWhite.cjstyles'), '');
     
   // Test the presence of .NET 4.0
   if (not(RegKeyExists(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4'))) then
@@ -420,8 +421,8 @@ end;
 procedure DeinitializeSetup();
 begin
   //Hide Window widget
-  ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
-  UnloadSkin();
+  //ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
+  //UnloadSkin();
 end;
 
 function ShouldInstalldotNET40(): Boolean;
@@ -534,10 +535,9 @@ begin
   BitmapImage1.width := Page.SurfaceWidth;
   BitmapImage1.height := Page.SurfaceHeight;
   BitmapImage1.Bitmap.LoadFromFile(BitmapFileName);
-  BitmapImage1.Left := 0 
+  BitmapImage1.Left := 0;
   BitmapImage1.Top := Page.Surface.Top + LabelWz.Height;
   BitmapImage1.Parent := Page.Surface;
-  
 end;
 
 procedure InitializeWizard;