TortoiseHg

TortoiseHg is the Tortoise Source Code user interface, built for the Mercurial source code management tool.

The packages below are configured to move all of the shortcuts into the a submenu "Software Development" in the Start Menu. Naturally part is optional.


<package id="tortoisehg" name="TortoiseHg" revision="20110309.16" reboot="false" priority="10">
	<depends package-id="software-dev-menu" />
	<depends package-id="adobereader10"/>
 
	<variable name="shortcutPath" value="%ALLUSERSPROFILE%\Start Menu\Programs\Software Development\TortoiseHg\TortoiseHg Workbench.lnk" />
 
	<check type="logical" condition="and">
		<check type="logical" condition="or">
			<check type="uninstall" condition="exists" path="TortoiseHg 2.0.0 (x86)" />
			<check type="uninstall" condition="exists" path="TortoiseHg 2.0.0 (x64)" />
		</check>
		<check 
			type="file" 
			condition="exists" 
			path='%shortcutPath%'
		/>
	</check>
		
	<!-- install -->
	<install cmd='msiexec /qn /i "%SOFTWARE%\Utilities\tortoise\tortoisehg-2.0.0-hg-1.8-%PROCESSOR_ARCHITECTURE%.msi"'>
		<exit code="0" />
        	<exit code="3010" restart="delayed"/> <!-- just tells us we need to restart -->
	</install>
	<install cmd='%COMSPEC% /C if not exist "%shortcutPath%"s xcopy "%ALLUSERSPROFILE%\Start Menu\Programs\TortoiseHg\*" "%ALLUSERSPROFILE%\Start Menu\Programs\Software Development\TortoiseHg\" /S /Y /I' />
	<install cmd='%COMSPEC% /C if exist "%ALLUSERSPROFILE%\Start Menu\Programs\TortoiseHg\TortoiseHg Workbench.lnk" rmdir /S /Q "%ALLUSERSPROFILE%\Start Menu\Programs\TortoiseHg\"' />
		
	<!-- upgrade -->
	<upgrade cmd='msiexec /qn /i "%SOFTWARE%\Utilities\tortoise\tortoisehg-2.0.0-hg-1.8-%PROCESSOR_ARCHITECTURE%.msi"'>
		<exit code="0" />
        	<exit code="3010" restart="delayed"/> <!-- just tells us we need to restart -->
	</upgrade>
	<upgrade cmd='%COMSPEC% /C if not exist "%shortcutPath%" xcopy "%ALLUSERSPROFILE%\Start Menu\Programs\TortoiseHg\*" "%ALLUSERSPROFILE%\Start Menu\Programs\Software Development\TortoiseHg\" /S /Y /I' />
		<upgrade cmd='%COMSPEC% /C if exist "%ALLUSERSPROFILE%\Start Menu\Programs\TortoiseHg\TortoiseHg Workbench.lnk" rmdir /S /Q "%ALLUSERSPROFILE%\Start Menu\Programs\TortoiseHg\"' />
		
	<!-- remove -->
	<remove  cmd='%COMSPEC% /c if exist %shortcutPath% rmdir /S /Q "%ALLUSERSPROFILE%\Start Menu\Programs\Software Development\TortoiseHg\"' />
	<!-- x86 version -->
	<remove cmd='msiexec /qn /x {4A2987AD-5E16-415E-ADAC-2BCEA7E025D2}' >
		<exit code="0" />
		<exit code="1605" /> <!-- just in case this isn't the version installed -->
        	<exit code="3010" restart="delayed"/> <!-- just tells us we need to restart -->
	</remove>
		
	<!-- AMD64 version -->
	<remove cmd='msiexec /qn /x {E0FB55DF-32EF-41E4-92D2-B89EAF64D1AC}' >
		<exit code="0" />
		<exit code="1605" /> <!-- just in case this isn't the version installed -->
        	<exit code="3010" restart="delayed"/> <!-- just tells us we need to restart -->
	</remove>
</package>

The "Software Development" submenu in the Start Menu:

<package id="software-dev-menu" name="software-dev-menu" revision="20110309.2" reboot="false" priority="0">
	<variable name="dirPath" value="%ALLUSERSPROFILE%\Start Menu\Programs\Software Development" />
	<check type="execute" path='%COMSPEC% /C if exist "%dirPath%" (exit /B 0) else (exit /B 1) ' condition="exitcodeequalto" value="0"/>
	<install cmd='%COMSPEC% /C mkdir "%dirPath%"' />
	<remove cmd='%COMSPEC% /C rmdir /S /Q  "%dirPath%"' />
</package>