[Pkg-owncloud-commits] [owncloud-client] 321/332: NSIS: Add a packaging routine for the overlay icons

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Aug 14 21:07:17 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 fa8f6f91c46b093b74581a59f65b3d71a521609c
Author: Daniel Molkentin <danimo at owncloud.com>
Date:   Thu Aug 7 15:54:06 2014 +0200

    NSIS: Add a packaging routine for the overlay icons
---
 cmake/modules/NSIS.template.in | 86 ++++++++++++++++++++++++++++++++++++------
 1 file changed, 74 insertions(+), 12 deletions(-)

diff --git a/cmake/modules/NSIS.template.in b/cmake/modules/NSIS.template.in
index 530b772..aaa1956 100644
--- a/cmake/modules/NSIS.template.in
+++ b/cmake/modules/NSIS.template.in
@@ -277,10 +277,60 @@ 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'
+   ${Else}
+      ExecWait '"$OUTDIR\vcredist_x86.exe" /install /quiet'
+   ${EndIf}
+   Delete "$OUTDIR\vcredist_x86.exe"
+   Delete "$OUTDIR\vcredist_x64.exe"
+FunctionEnd
+
 ##############################################################################
 #                                                                            #
 #   RE-INSTALLER FUNCTIONS                                                   #
@@ -438,7 +488,7 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
    ;QtKeyChain stuff
    File "${MING_BIN}\libqt5keychain.dll"
 
-   ; ownCloud plugin
+   ;ownCloud plugin
    File "${MING_BIN}\libintl-8.dll"
    File "${MING_BIN}\libneon-27.dll"
    File "${MING_BIN}\libproxy.dll"
@@ -450,29 +500,32 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
    File "${MING_BIN}\libstdc++-6.dll"
    File "${MING_BIN}\libwinpthread-1.dll"
 
-   ; CSync configs
+   ;CSync configs
    File "${SOURCE_PATH}/sync-exclude.lst"
 
 SectionEnd
 
-SectionGroup $SectionGroup_Shortcuts
-
 !ifdef OPTION_SECTION_SC_SHELL_EXT
    ${MementoSection} $OPTION_SECTION_SC_SHELL_EXT_SECTION SEC_SHELL_EXT
       SectionIn 1 2
       SetDetailsPrint textonly
       DetailPrint $OPTION_SECTION_SC_SHELL_EXT_DetailPrint
-      SetOutPath "$INSTDIR/shellext"
-      ${If} ${RunningX64}
-         ExecWait '"${BUILD_PATH}/vcredist_x64.exe" /qn'
-         File ${SOURCE_PATH}\*_x64.dll
-      ${Else}
-         ExecWait '"${BUILD_PATH}/vcredist_x86.exe" /qn'
-         File ${SOURCE_PATH}\*_x86.dll
-      ${EndIf}
+      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 ""
    ${MementoSectionEnd}
 !endif
 
+SectionGroup $SectionGroup_Shortcuts
+
 !ifdef OPTION_SECTION_SC_START_MENU
    ${MementoSection} $OPTION_SECTION_SC_START_MENU_SECTION SEC_START_MENU
       SectionIn 1 2 3
@@ -618,6 +671,15 @@ Section Uninstall
 
    DeleteRegKey HKCR "${APPLICATION_NAME}"
 
+   ;Shell extension
+   !ifdef OPTION_SECTION_SC_SHELL_EXT
+      ${If} ${HasSection} SEC_SHELL_EXT
+         !insertmacro StopExplorer
+         Call Un.RegisterShellExt
+         !insertmacro StartExplorer "Un."
+      ${EndIf}
+   !endif
+
    ;Start menu shortcut
    !ifdef OPTION_SECTION_SC_START_MENU
       SetShellVarContext all

-- 
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