[Pkg-owncloud-commits] [owncloud-client] 90/115: Use InstallLib to install the overlay icons

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Aug 29 22:04:05 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit ccf532672b11fb87b473397d0446e528f9b37440
Author: Daniel Molkentin <danimo at owncloud.com>
Date:   Wed Aug 20 16:07:22 2014 +0200

    Use InstallLib to install the overlay icons
    
    This allows for a cleaner expirience
---
 cmake/modules/NSIS.template.in | 70 ++++++++++++------------------------------
 1 file changed, 19 insertions(+), 51 deletions(-)

diff --git a/cmake/modules/NSIS.template.in b/cmake/modules/NSIS.template.in
index aaa1956..6ece476 100644
--- a/cmake/modules/NSIS.template.in
+++ b/cmake/modules/NSIS.template.in
@@ -95,6 +95,7 @@ ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
 !include WordFunc.nsh  ;Used by VersionCompare macro function.
 !include FileFunc.nsh  ;Used to read out parameters
 !include UAC.nsh ;Used by the UAC elevation to install as user or admin.
+!include Library.nsh ;Used by the COM registration for shell extensions
 !include x64.nsh ;Used to determine the right arch for the shell extensions
 
 ;-----------------------------------------------------------------------------
@@ -277,50 +278,10 @@ FunctionEnd
    no_process_${processName}_to_end:
 !macroend
 
-!macro StartExplorerAsUserMacro un
-   Function ${un}StartExplorerAsUser
-      Exec "$WINDIR\explorer.exe"
-   FunctionEnd
-!macroend
-
-!insertmacro StartExplorerAsUserMacro ""
-!insertmacro StartExplorerAsUserMacro "un."
-
-!macro StartExplorer un
-   DetailPrint "Starting Explorer..."
-   ${UAC.CallFunctionAsUser} ${un}StartExplorerAsUser
-!macroend
-
-!macro StopExplorer
-   DetailPrint "Terminated Explorer..."
-   FindWindow $R0 "Shell_TrayWnd"
-   SendMessage $R0 0x5B4 0 0
-   #Processes::KillProcess explorer.exe
-   Sleep 1500
-   DetailPrint "Continuing..."
-!macroend
-
 Function EnsureOwncloudShutdown
    !insertmacro CheckAndConfirmEndProcess "${APPLICATION_EXECUTABLE}"
 FunctionEnd
 
-Function RegisterShellExt
-   SetOutPath "$INSTDIR\shellext"
-   ${If} ${RunningX64}
-      ExecWait '"$SYSDIR\regsvr32.exe" /s "$OUTDIR\OCOverlays_x64.dll"'
-   ${Else}
-      ExecWait '"$SYSDIR\regsvr32.exe" /s "$OUTDIR\OCOverlays_x86.dll"'
-   ${EndIf}
-FunctionEnd
-
-Function Un.RegisterShellExt
-   ${If} ${RunningX64}
-      ExecWait '"$SYSDIR\regsvr32.exe" /u /s "$INSTDIR\shellext\OCOverlays_x64.dll"'
-   ${Else}
-      ExecWait '"$SYSDIR\regsvr32.exe" /u /s "$INSTDIR\shellext\OCOverlays_x86.dll"'
-   ${EndIf}
-FunctionEnd
-
 Function InstallRedistributables
    ${If} ${RunningX64}
       ExecWait '"$OUTDIR\vcredist_x64.exe" /install /quiet'
@@ -510,17 +471,18 @@ SectionEnd
       SectionIn 1 2
       SetDetailsPrint textonly
       DetailPrint $OPTION_SECTION_SC_SHELL_EXT_DetailPrint
-      SetOutPath "$INSTDIR\shellext"
-      File "${SOURCE_PATH}\binary\shell_integration\windows\Release\x64\OCUtil_x64.dll"
-      File "${SOURCE_PATH}\binary\shell_integration\windows\Release\x64\OCOverlays_x64.dll"
-      File "${SOURCE_PATH}\binary\shell_integration\windows\Release\Win32\OCUtil_x86.dll"
-      File "${SOURCE_PATH}\binary\shell_integration\windows\Release\Win32\OCOverlays_x86.dll"
       File "${BUILD_PATH}\vcredist_x86.exe"
       File "${BUILD_PATH}\vcredist_x64.exe"
       Call InstallRedistributables
-      Call RegisterShellExt
-      !insertMacro StopExplorer
-      !insertMacro StartExplorer ""
+      ${If} ${RunningX64}
+         !define LIBRARY_X64
+         !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\x64\OCUtil_x64.dll" "$INSTDIR/shellext/OCUtil_x64.dll" "$INSTDIR/shellext"
+         !insertmacro InstallLib REGDLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\x64\OCOverlays_x64.dll" "$INSTDIR/shellext/OCOverlays_x64.dll" "$INSTDIR/shellext"
+         !undef LIBRARY_X64
+     ${Else}
+         !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\Win32\OCUtil_x86.dll" "$INSTDIR/shellext/OCUtil_x86.dll" "$INSTDIR/shellext"
+         !insertmacro InstallLib REGDLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\Win32\OCOverlays_x86.dll" "$INSTDIR/shellext/OCOverlays_x86.dll" "$INSTDIR/shellext"
+      ${Endif}
    ${MementoSectionEnd}
 !endif
 
@@ -673,10 +635,16 @@ Section Uninstall
 
    ;Shell extension
    !ifdef OPTION_SECTION_SC_SHELL_EXT
+      !define LIBRARY_COM
+      !define LIBRARY_SHELL_EXTENSION
       ${If} ${HasSection} SEC_SHELL_EXT
-         !insertmacro StopExplorer
-         Call Un.RegisterShellExt
-         !insertmacro StartExplorer "Un."
+        !define LIBRARY_X64
+        !insertmacro UnInstallLib DLL NOTSHARED REBOOT_PROTECTED "$INSTDIR/shellext/OCUtil_x64.dll"
+        !insertmacro UnInstallLib REGDLL NOTSHARED REBOOT_PROTECTED "$INSTDIR/shellext/OCOverlays_x64.dll"
+        !undef LIBRARY_X64
+     ${Else}
+        !insertmacro UnInstallLib DLL NOTSHARED REBOOT_PROTECTED "$INSTDIR/shellext/OCUtil_x86.dll"
+        !insertmacro UnInstallLib REGDLL NOTSHARED REBOOT_PROTECTED "$INSTDIR/shellext/OCOverlays_x86.dll"
       ${EndIf}
    !endif
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list