Difference between revisions of "Unison"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
m
Line 35: Line 35:
 
</package>
 
</package>
 
</source>
 
</source>
 +
 +
A slightly more sophisticated version using PuTTY agent to manage SSH key and sets up the menu shortcuts appropriately. This requires a small .bat file (below) and nircmd.exe to be included in the install directory. You will need to ensure that you have generated the private keys appropriately and have copied them onto your machines etc.
 +
 +
<source lang="xml">
 +
<packages>
 +
<package id="unison" name="Unison" revision="20110517.3" priority="10" reboot="false" >
 +
 +
<depends package-id="putty" />
 +
<depends package-id="pkgvcruntime2008" />
 +
<depends package-id="gkt-runtime" />
 +
 +
<check type="logical" condition="and">
 +
<check type="execute" path='%COMSPEC% /C if defined UNISONLOCALHOSTNAME (exit /B 0) else (exit /B 1)' condition="exitcodeequalto" value="0"/>
 +
<check type="file" condition="exists" path='%PROGRAMFILES%\unison\Unison-2.32.52 Gtk+.exe' />
 +
<check type="file" condition="exists" path='%PROGRAMFILES%\unison\Unison-2.32.52 Text.exe' />
 +
<check type="file" condition="exists" path='%PROGRAMFILES%\unison\ssh.exe' />
 +
<check type="file" condition="exists" path='%PROGRAMFILES%\unison\nircmd.exe' />
 +
<check type="file" condition="exists" path='%PROGRAMFILES%\unison\unison-with-putty-2.32.52.bat' />
 +
</check>
 +
 +
<install cmd='%COMSPEC% /C mkdir "%PROGRAMFILES%\unison"' >
 +
<exit code="0" />
 +
<exit code="1" />
 +
</install>
 +
<install cmd='%COMSPEC% /C xcopy /Y /R "%SOFTWARE%\Utilities\unison\*" "%programfiles%\unison\"' />
 +
<install cmd='"%SOFTWARE%\wpkg\tools\3rd-party\nircmd-x32\nircmdc.exe" shortcut "~$folder.programfiles$\unison\nircmd.exe" "~$folder.common_start_menu$\Programs\File Utilities" "Unison" "exec hide ~$folder.programfiles$\unison\unison-with-putty-2.32.52.bat" "~$folder.programfiles$\unison\Unison-2.32.52 Gtk+.exe"'>
 +
<exit code="4206857" />
 +
</install>
 +
<install cmd='%COMSPEC% /C reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v UNISONLOCALHOSTNAME /d %COMPUTERNAME%' >
 +
<exit code="0" reboot="delayed" />
 +
</install>
 +
 +
<upgrade cmd='%COMSPEC% /C mkdir "%PROGRAMFILES%\unison"' >
 +
<exit code="0" />
 +
<exit code="1" />
 +
</upgrade>
 +
<upgrade cmd='%COMSPEC% /C xcopy /Y /R "%SOFTWARE%\Utilities\unison\*" "%programfiles%\unison\"' />
 +
<upgrade cmd='"%SOFTWARE%\wpkg\tools\3rd-party\nircmd-x32\nircmdc.exe" shortcut "~$folder.programfiles$\unison\nircmd.exe" "~$folder.common_start_menu$\Programs\File Utilities" "Unison" "exec hide ~$folder.programfiles$\unison\unison-with-putty-2.32.52.bat" "~$folder.programfiles$\unison\Unison-2.32.52 Gtk+.exe"'>
 +
<exit code="4206857" />
 +
</upgrade>
 +
<upgrade cmd='%COMSPEC% /C reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v UNISONLOCALHOSTNAME /d %COMPUTERNAME%' >
 +
<exit code="0" reboot="delayed" />
 +
</upgrade>
 +
 +
<remove cmd='%COMSPEC% /C rmdir /S /Q "%PROGRAMFILES%\unison"' />
 +
 +
</package>
 +
</packages>
 +
</source>
 +
 +
Contents of unison-with-putty-2.32.52.bat
 +
<source>
 +
@echo off
 +
"%programfiles%\putty\pageant.exe" "path-to-your-private-key.ppk" -c "%programfiles%\unison\Unison-2.32.52 Gtk+.exe"
 +
</source>
 +
  
 
[[Category: Silent Installers]]
 
[[Category: Silent Installers]]

Revision as of 19:03, 19 May 2011

Unison is a file/directory synchronisation tool. There are various Windows ports, including some which are available here. There is not an active installer, so you will need just copy the relevant files into a suitable directory and create a shortcut in the start menu.

<package id="unison" name="Unison" revision="20110416.10" priority="10" reboot="false" >
 
	<depends package-id="putty" />
	<depends package-id="pkgvcruntime2008" />
	<depends package-id="gkt-runtime" />
	
	<check type="logical" condition="and">		
		<check type="file" condition="exists" path='%PROGRAMFILES%\unison\Unison-2.32.52 Gtk+.exe' />
		<check type="file" condition="exists" path='%PROGRAMFILES%\unison\Unison-2.32.52 Text.exe' />
		<check type="file" condition="exists" path='%PROGRAMFILES%\unison\ssh.exe' />
	</check>
			
	<install cmd='%COMSPEC% /C mkdir "%PROGRAMFILES%\unison"' >
		<exit code="0" />
		<exit code="1" />
	</install>
	<install cmd='%COMSPEC% /C xcopy /Y /R "%SOFTWARE%\Utilities\unison\*" "%programfiles%\unison\"' />
	<install cmd='"%SOFTWARE%\wpkg\tools\3rd-party\nircmd-x32\nircmdc.exe" shortcut "~$folder.programfiles$\unison\Unison-2.32.52 Gtk+.exe" "~$folder.common_start_menu$\Programs" "Unison"'>
		<exit code="4206857" />
	</install>

	<upgrade cmd='%COMSPEC% /C mkdir "%PROGRAMFILES%\unison"' >
		<exit code="0" />
		<exit code="1" />
	</upgrade>
	<upgrade cmd='%COMSPEC% /C xcopy /Y /R "%SOFTWARE%\Utilities\unison\*" "%programfiles%\unison\"' />
	<upgrade cmd='"%SOFTWARE%\wpkg\tools\3rd-party\nircmd-x32\nircmdc.exe" shortcut "~$folder.programfiles$\unison\Unison-2.32.52 Gtk+.exe" "~$folder.common_start_menu$\Programs" "Unison"'>
		<exit code="4206857" />
	</upgrade>

	<remove cmd='%COMSPEC% /C rmdir /S /Q "%PROGRAMFILES%\unison"' />
</package>

A slightly more sophisticated version using PuTTY agent to manage SSH key and sets up the menu shortcuts appropriately. This requires a small .bat file (below) and nircmd.exe to be included in the install directory. You will need to ensure that you have generated the private keys appropriately and have copied them onto your machines etc.

<packages>
	<package id="unison" name="Unison" revision="20110517.3" priority="10" reboot="false" >
 
		<depends package-id="putty" />
		<depends package-id="pkgvcruntime2008" />
		<depends package-id="gkt-runtime" />
	 
		<check type="logical" condition="and">
			<check type="execute" path='%COMSPEC% /C if defined UNISONLOCALHOSTNAME (exit /B 0) else (exit /B 1)' condition="exitcodeequalto" value="0"/>		
			<check type="file" condition="exists" path='%PROGRAMFILES%\unison\Unison-2.32.52 Gtk+.exe' />
			<check type="file" condition="exists" path='%PROGRAMFILES%\unison\Unison-2.32.52 Text.exe' />
			<check type="file" condition="exists" path='%PROGRAMFILES%\unison\ssh.exe' />
			<check type="file" condition="exists" path='%PROGRAMFILES%\unison\nircmd.exe' />
			<check type="file" condition="exists" path='%PROGRAMFILES%\unison\unison-with-putty-2.32.52.bat' />
		</check>
	 
		<install cmd='%COMSPEC% /C mkdir "%PROGRAMFILES%\unison"' >
			<exit code="0" />
			<exit code="1" />
		</install>
		<install cmd='%COMSPEC% /C xcopy /Y /R "%SOFTWARE%\Utilities\unison\*" "%programfiles%\unison\"' />
		<install cmd='"%SOFTWARE%\wpkg\tools\3rd-party\nircmd-x32\nircmdc.exe" shortcut "~$folder.programfiles$\unison\nircmd.exe" "~$folder.common_start_menu$\Programs\File Utilities" "Unison" "exec hide ~$folder.programfiles$\unison\unison-with-putty-2.32.52.bat" "~$folder.programfiles$\unison\Unison-2.32.52 Gtk+.exe"'>
			<exit code="4206857" />
		</install>
		<install cmd='%COMSPEC% /C reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v UNISONLOCALHOSTNAME /d %COMPUTERNAME%' >
			<exit code="0" reboot="delayed" />
		</install>
	 
		<upgrade cmd='%COMSPEC% /C mkdir "%PROGRAMFILES%\unison"' >
			<exit code="0" />
			<exit code="1" />
		</upgrade>
		<upgrade cmd='%COMSPEC% /C xcopy /Y /R "%SOFTWARE%\Utilities\unison\*" "%programfiles%\unison\"' />
		<upgrade cmd='"%SOFTWARE%\wpkg\tools\3rd-party\nircmd-x32\nircmdc.exe" shortcut "~$folder.programfiles$\unison\nircmd.exe" "~$folder.common_start_menu$\Programs\File Utilities" "Unison" "exec hide ~$folder.programfiles$\unison\unison-with-putty-2.32.52.bat" "~$folder.programfiles$\unison\Unison-2.32.52 Gtk+.exe"'>
			<exit code="4206857" />
		</upgrade>
		<upgrade cmd='%COMSPEC% /C reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v UNISONLOCALHOSTNAME /d %COMPUTERNAME%' >
			<exit code="0" reboot="delayed" />
		</upgrade>

		<remove cmd='%COMSPEC% /C rmdir /S /Q "%PROGRAMFILES%\unison"' />

	</package>
</packages>

Contents of unison-with-putty-2.32.52.bat

@echo off
"%programfiles%\putty\pageant.exe" "path-to-your-private-key.ppk" -c "%programfiles%\unison\Unison-2.32.52 Gtk+.exe"