TortoiseGit

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search

TortoiseGit is a Windows GUI for GIT which is operated from the Windows Explorer Context Menu.

Homepage: https://tortoisegit.org/


Version 2.4.0.2[edit]

To install tortoisegit you install the localized version (tortoisegit-de, german in this example, goto https://tortoisegit.org/download/ for more languages) which depends on the tortoisegit base installation. If you want to install it only with english just use packageid "tortoisegit" and discard the localized version.

<?xml version="1.0" encoding="UTF-8"?>

<packages:packages
        xmlns:packages="http://www.wpkg.org/packages" xmlns:wpkg="http://www.wpkg.org/wpkg" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.wpkg.org/packages ../../xsd/packages.xsd" >

    <package id="tortoisegit"
            name="tortoisegit"
            revision="%PKG_VERSION%_1"
            reboot="false"
            priority="10">

        <variable name="PKG_VERSION"        value="2.4.0.2" />
        <variable name="PKG_NAME"           value="TortoiseGit" />
        <variable name="PKG_SOURCE"         value="%SOFTWARE%\tools\%PKG_NAME%"/>
        <variable name="PKG_DESTINATION"    value="%ProgramFiles%\"/>
        <variable name="PKG_INSTALL_SWITCH" value="ALLUSERS=1"/>
        <variable name="PKG_REMOVE_SWITCH"  value="ALLUSERS=1"/>

		<check type="host" condition="architecture" value="x64" />
        <check type="uninstall" condition="exists" path="TortoiseGit %PKG_VERSION% (64 bit)" />

        <install cmd='MsiExec.exe /quiet /norestart /log "%TMP%\%PKG_NAME%.log" /i "%PKG_SOURCE%\%PKG_NAME%-%PKG_VERSION%-64bit.msi" %PKG_INSTALL_SWITCH%' />
		<install cmd='"%PKG_SOURCE%\helper.cmd" postinstall'/>
		
        <upgrade include="install" />

        <remove cmd='MsiExec.exe /quiet /norestart /log "%TMP%\%PKG_NAME%.log" /x "%PKG_SOURCE%\%PKG_NAME%-%PKG_VERSION%-64bit.msi" %PKG_REMOVE_SWITCH%' />
		<remove cmd='"%PKG_SOURCE%\helper.cmd" postremove'/>
    </package>
    <package id="tortoisegit-de"
            name="tortoisegit-de"
            revision="%PKG_VERSION%_1"
            reboot="false"
            priority="10">

		<depends package-id="tortoisegit"/>	
			
        <variable name="PKG_VERSION"        value="2.4.0.0" />
        <variable name="PKG_NAME"           value="TortoiseGit" />
        <variable name="PKG_SOURCE"         value="%SOFTWARE%\tools\%PKG_NAME%\%PKG_NAME%-LanguagePack-%PKG_VERSION%-64bit-de.msi"/>
        <variable name="PKG_DESTINATION"    value="%ProgramFiles%\"/>
        <variable name="PKG_INSTALL_SWITCH" value="ALLUSERS=1"/>
        <variable name="PKG_REMOVE_SWITCH"  value="ALLUSERS=1"/>

		<check type="host" condition="architecture" value="x64" />
        <check type="file" condition="versiongreaterorequal" path="%PKG_DESTINATION%\TortoiseGit\Languages\TortoiseProc1031.dll" value="%PKG_VERSION%" />

        <install cmd='MsiExec.exe /quiet /norestart /log "%TMP%\%PKG_NAME%.log" /i "%PKG_SOURCE%" %PKG_INSTALL_SWITCH%' />

        <upgrade include="install" />

        <remove cmd='MsiExec.exe /quiet /norestart /log "%TMP%\%PKG_NAME%.log" /x "%PKG_SOURCE%" %PKG_REMOVE_SWITCH%' />
    </package>
</packages:packages>

The Package contains the possibility for moving the Icons to another folder, by calling a batch file named "helper.cmd":

@echo off
set STARTMENU_PROGRAMS=%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs

IF "%~1"=="postinstall" GOTO :postinstall

IF "%~1"=="postremove" GOTO :postremove

:postinstall
md "%STARTMENU_PROGRAMS%\Tools"
move "%STARTMENU_PROGRAMS%\TortoiseGit" "%STARTMENU_PROGRAMS%\Tools"

goto :end

:postremove
rd /s /q "%STARTMENU_PROGRAMS%\Tools\TortoiseGit"
rem del /S /F /Q "%STARTMENU_PROGRAMS%\Tools\TortoiseGit"

:end