From f5f7760711e3c9a3f04de3163bed0c07288e3d54 Mon Sep 17 00:00:00 2001 From: Heiko Voigt Date: Sat, 4 Feb 2012 13:34:30 +1300 Subject: [PATCH] git-cheetah: Compile and use 64bit shell extension in the installer On Windows 64bit the explorer is a 64bit process. Thus a 32bit dll can not be loaded. To support the context menu plugin on 64bit windows we compile a seperate 64bit dll of cheetah and register it in case the installer is run on 64bit. The fact that there are two architectures is now not visible in the installer anymore since it automatically chooses the right dll. Signed-off-by: Heiko Voigt --- share/WinGit/copy-files.sh | 1 + share/WinGit/install.iss | 38 +++++++++++++++++++------------------- share/WinGit/release.sh | 6 +++++- src/git-cheetah | 2 +- 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/share/WinGit/copy-files.sh b/share/WinGit/copy-files.sh index ac7cc626..2fb42494 100755 --- a/share/WinGit/copy-files.sh +++ b/share/WinGit/copy-files.sh @@ -93,6 +93,7 @@ cp $MSYSGITROOT/etc/gitattributes etc/ && cp $MSYSGITROOT/share/WinGit/Git\ Bash.vbs . && mkdir git-cheetah && cp $MSYSGITROOT/src/git-cheetah/explorer/git_shell_ext.dll git-cheetah/ && +cp $MSYSGITROOT/src/git-cheetah/explorer/git_shell_ext64.dll git-cheetah/ && cp $MSYSGITROOT/share/WinGit/ReleaseNotes.rtf . && sed 's/^\. .*\(git-completion.bash\)/. \/etc\/\1/' \ < $MSYSGITROOT/etc/profile > etc/profile && diff --git a/share/WinGit/install.iss b/share/WinGit/install.iss index 17bc3403..ee9e96ba 100644 --- a/share/WinGit/install.iss +++ b/share/WinGit/install.iss @@ -51,7 +51,7 @@ Name: ext; Description: Windows Explorer integration; Types: custom Name: ext\reg; Description: Context menu entries; Flags: exclusive; Types: custom Name: ext\reg\shellhere; Description: Git Bash Here; Types: custom Name: ext\reg\guihere; Description: Git GUI Here; Types: custom -Name: ext\cheetah; Description: git-cheetah shell extension (32-bit only); Flags: exclusive; Types: custom +Name: ext\cheetah; Description: git-cheetah shell extension; Flags: exclusive; Types: custom Name: assoc; Description: Associate .git* configuration files with the default text editor; Types: custom Name: assoc_sh; Description: Associate .sh files to be run with Bash; Types: custom Name: consolefont; Description: {#COMP_CONSOLE_FONT}; Types: custom @@ -59,8 +59,9 @@ Name: consolefont; Description: {#COMP_CONSOLE_FONT}; Types: custom [Files] ; Install files that might be in use during setup under a different name. Source: git-cheetah\git_shell_ext.dll; DestDir: {app}\git-cheetah; DestName: git_shell_ext.dll.new; Flags: replacesameversion; Components: ext\cheetah +Source: git-cheetah\git_shell_ext64.dll; DestDir: {app}\git-cheetah; DestName: git_shell_ext64.dll.new; Flags: replacesameversion; Components: ext\cheetah -Source: *; DestDir: {app}; Excludes: \*.bmp, gpl-2.0.rtf, \*.iss, \tmp.*, \bin\*install*, \git-cheetah\git_shell_ext.dll; Flags: recursesubdirs replacesameversion +Source: *; DestDir: {app}; Excludes: \*.bmp, gpl-2.0.rtf, \*.iss, \tmp.*, \bin\*install*, \git-cheetah\git_shell_ext.dll, \git-cheetah\git_shell_ext64.dll; Flags: recursesubdirs replacesameversion Source: ReleaseNotes.rtf; DestDir: {app}; Flags: isreadme replacesameversion [Icons] @@ -278,11 +279,12 @@ begin // Use the Restart Manager API when installing the shell extension on Windows Vista and above. if Version.Major>=6 then begin - SetArrayLength(Modules,4); + SetArrayLength(Modules,5); Modules[0]:=ExpandConstant('{app}\bin\msys-1.0.dll'); Modules[1]:=ExpandConstant('{app}\bin\tcl85.dll'); Modules[2]:=ExpandConstant('{app}\bin\tk85.dll'); Modules[3]:=ExpandConstant('{app}\git-cheetah\git_shell_ext.dll'); + Modules[4]:=ExpandConstant('{app}\git-cheetah\git_shell_ext64.dll'); SessionHandle:=FindProcessesUsingModules(Modules,Processes); end else begin SetArrayLength(Modules,3); @@ -291,7 +293,10 @@ begin Modules[2]:=ExpandConstant('{app}\bin\tk85.dll'); SessionHandle:=FindProcessesUsingModules(Modules,ProcsCloseRequired); - SessionHandle:=FindProcessesUsingModule(ExpandConstant('{app}\git-cheetah\git_shell_ext.dll'),ProcsCloseOptional) or SessionHandle; + SetArrayLength(Modules,2); + Modules[0]:=ExpandConstant('{app}\git-cheetah\git_shell_ext.dll'); + Modules[1]:=ExpandConstant('{app}\git-cheetah\git_shell_ext64.dll'); + SessionHandle:=FindProcessesUsingModules(Modules,ProcsCloseOptional) or SessionHandle; // Misuse the "Restartable" flag to indicate which processes are required // to be closed before setup can continue, and which just should be closed @@ -343,19 +348,6 @@ var BtnPlink:TButton; Data:String; begin - // Until we have a 64-bit version of git-cheetah, disable it on 64-bit Windows. - if isWin64 then begin - for i:=0 to WizardForm.ComponentsList.Items.Count-1 do begin - Data:=LowerCase(WizardForm.ComponentsList.ItemCaption[i]); - if Pos('context',Data)>0 then begin - // Select the Registry-based context menu entries. - WizardForm.ComponentsList.Checked[i]:=True; - end else if Pos('cheetah',Data)>0 then begin - // Disable the git-cheetah shell extension. - WizardForm.ComponentsList.ItemEnabled[i]:=False; - end; - end; - end; PrevPageID:=wpSelectProgramGroup; @@ -1147,7 +1139,11 @@ begin if IsComponentSelected('ext\cheetah') then begin DeleteContextMenuEntries; - FileName:=AppDir+'\git-cheetah\git_shell_ext.dll'; + if isWin64 then begin + FileName:=AppDir+'\git-cheetah\git_shell_ext64.dll'; + end else begin + FileName:=AppDir+'\git-cheetah\git_shell_ext.dll'; + end; if not ReplaceInUseFile(FileName,FileName+'.new',True) then begin Log('Line {#__LINE__}: Replacing file "'+FileName+'" failed.'); end; @@ -1403,7 +1399,11 @@ begin DeleteContextMenuEntries; - FileName:=AppDir+'\git-cheetah\git_shell_ext.dll'; + if isWin64 then begin + FileName:=AppDir+'\git-cheetah\git_shell_ext64.dll'; + end else begin + FileName:=AppDir+'\git-cheetah\git_shell_ext.dll'; + end; if FileExists(FileName) then begin if not UnregisterServer(Is64BitInstallMode,FileName,False) then begin Msg:='Line {#__LINE__}: Unable to unregister file "'+FileName+'". Please do it manually by running "regsvr32 /u '+ExtractFileName(FileName)+'".'; diff --git a/share/WinGit/release.sh b/share/WinGit/release.sh index 0679a85c..81437391 100755 --- a/share/WinGit/release.sh +++ b/share/WinGit/release.sh @@ -73,7 +73,11 @@ test "$do_compile" && { (cd git && create_msysgit_tag $version && make install) && - (cd src/git-cheetah/explorer/ && make) + /src/mingw-w64/release-easy.sh && + /src/mingw-w64/release-zlib.sh && + (cd src/git-cheetah/explorer/ && + make objects-clean && make && + make objects-clean && make W64=1) } || exit 1 } diff --git a/src/git-cheetah b/src/git-cheetah index d1ad8f12..a764b6cf 160000 --- a/src/git-cheetah +++ b/src/git-cheetah @@ -1 +1 @@ -Subproject commit d1ad8f128319afc14017f56dd7344488f3fff429 +Subproject commit a764b6cff2c7a3e195d7a029b7635d3aaabe9c7d -- 2.11.4.GIT