From b66f73cb6005f877d9a70e09c06bd30f4c05093e Mon Sep 17 00:00:00 2001
From: Mario Fetka <mario.fetka@gmail.com>
Date: Wed, 27 Mar 2013 14:08:57 +0100
Subject: [PATCH] add file association for supported file types

---
 CLIENT_DATA/setup3264.ins | 40 +++++++++++++++++++++++++++++++++++----
 1 file changed, 36 insertions(+), 4 deletions(-)

diff --git a/CLIENT_DATA/setup3264.ins b/CLIENT_DATA/setup3264.ins
index 22735c2..47912dc 100644
--- a/CLIENT_DATA/setup3264.ins
+++ b/CLIENT_DATA/setup3264.ins
@@ -78,7 +78,8 @@ else
 		comment "Copy files"
 		Files_install_32 /32Bit
 		Files_install_config /AllNtUserProfiles
-		Dosbatch_set_config_32
+		DosInAnIcon_set_config_32
+		DosInAnIcon_install_32
 		comment "Patch Registry"
 		Registry_install /32Bit
 		comment "Create shortcuts"
@@ -94,7 +95,8 @@ else
 		comment "Copy files"
 		Files_install_64 /64Bit
 		Files_install_config /AllNTUserProfiles
-		Dosbatch_set_config_64
+		DosInAnIcon_set_config_64
+		DosInAnIcon_install_64
 		comment "Patch Registry"
 		Registry_install /64Bit
 		comment "Create shortcuts"
@@ -109,6 +111,21 @@ copy "%ScriptPath%\Imagine.ini" "%UserProfileDir%\Anwendungsdaten\Imagine"
 [Winbatch_install_32]
 "$Install32Exe$" /S /D="$InstallDir32$"
 
+[DosInAnIcon_install_32]
+@echo off
+ 
+SET SC=HKLM\Software\Classes
+SET Extn=bmp-187 dds-188 gif-189 jpg-190 jpeg-190 pcx-191 png-192 psd-193 tga-194 tif-195 tiff-195
+ 
+FOR %%j IN (%Extn%) DO (
+        FOR /F "tokens=1,2 delims=-" %%A IN ("%%j") DO (
+                REG ADD %SC%\.%%A /VE /D "Imagine.%%A" /F
+                REG ADD %SC%\Imagine.%%A /VE /D "%%A Image" /F
+                REG ADD %SC%\Imagine.%%A\DefaultIcon /VE /D "$InstallDir32$\Imagine.dll,%%B" /F
+                REG ADD %SC%\Imagine.%%A\shell\open\command /VE /D "\"$InstallDir32$\Imagine.exe\" \"%%1\"" /F
+        )
+)
+
 [Files_install_32]
 ; copy the ini file to the InstallDir
 copy "$IniCfgFile$" "$InstallDir32$"
@@ -118,12 +135,27 @@ copy "%ScriptPath%\*.ini" "$InstallDir32$"
 ;
 copy -s "%ScriptPath%\X86\*.*" "$InstallDir32$"
 
-[Dosbatch_set_config_32]
+[DosInAnIcon_set_config_32]
 attrib +r "$InstallDir32$\Imagine.ini"
 
 [Winbatch_install_64]
 "$Install64Exe$" /S /D="$InstallDir64$"
 
+[DosInAnIcon_install_64]
+@echo off
+ 
+SET SC=HKLM\Software\Classes
+SET Extn=bmp-187 dds-188 gif-189 jpg-190 jpeg-190 pcx-191 png-192 psd-193 tga-194 tif-195 tiff-195
+ 
+FOR %%j IN (%Extn%) DO (
+        FOR /F "tokens=1,2 delims=-" %%A IN ("%%j") DO (
+                REG ADD %SC%\.%%A /VE /D "Imagine.%%A" /F
+                REG ADD %SC%\Imagine.%%A /VE /D "%%A Image" /F
+                REG ADD %SC%\Imagine.%%A\DefaultIcon /VE /D "$InstallDir64$\Imagine64.dll,%%B" /F
+                REG ADD %SC%\Imagine.%%A\shell\open\command /VE /D "\"$InstallDir64$\Imagine64.exe\" \"%%1\"" /F
+        )
+)
+
 [Files_install_64]
 ; copy the ini file to the InstallDir
 copy "$IniCfgFile$" "$InstallDir64$"
@@ -133,7 +165,7 @@ copy "%ScriptPath%\*.ini" "$InstallDir64$"
 ;
 copy -s "%ScriptPath%\X86_64\*.*" "$InstallDir64$"
 
-[Dosbatch_set_config_64]
+[DosInAnIcon_set_config_64]
 attrib +r "$InstallDir64$\Imagine.ini"
 
 [Registry_install]