Index: src/winhugs/installer/Parameters.h
===================================================================
RCS file: /cvs/hugs98/src/winhugs/installer/Parameters.h,v
retrieving revision 1.1
diff -u -r1.1 Parameters.h
--- src/winhugs/installer/Parameters.h	6 Oct 2005 11:18:43 -0000	1.1
+++ src/winhugs/installer/Parameters.h	12 Oct 2005 12:51:22 -0000
@@ -22,3 +22,5 @@
 
 #define Copyright		"1994-2005"
 
+#define Publisher		"The Hugs Team"
+#define Website			"http://www.haskell.org/hugs/"
Index: src/winhugs/installer/ShellCode.cpp
===================================================================
RCS file: /cvs/hugs98/src/winhugs/installer/ShellCode.cpp,v
retrieving revision 1.2
diff -u -r1.2 ShellCode.cpp
--- src/winhugs/installer/ShellCode.cpp	12 Oct 2005 12:04:00 -0000	1.2
+++ src/winhugs/installer/ShellCode.cpp	12 Oct 2005 12:53:11 -0000
@@ -120,16 +120,24 @@
 }
 
 
-void WriteRegistry(char* Path, char* Local, char* Value)
+void WriteRegistry(HKEY Root, char* Path, char* Local, char* Value)
 {
 	HKEY hKey;
-	RegCreateKey(HKEY_CLASSES_ROOT, Path, &hKey);
+	RegCreateKey(Root, Path, &hKey);
 	if (hKey != NULL)
 	{
 		RegSetValueEx(hKey, Local, 0, REG_SZ, (BYTE*) Value, strlen(Value)+1);
 		RegCloseKey(hKey);
 
-		WriteInstallLog("REG\tHKEY_CLASSES_ROOT\t%s", Path);
+		char* RootName;
+		if (Root == HKEY_CLASSES_ROOT)
+			RootName = "HKEY_CLASSES_ROOT";
+		else if (Root == HKEY_LOCAL_MACHINE)
+			RootName = "HKEY_LOCAL_MACHINE";
+		else
+			RootName = "<UNKNOWN>";
+
+		WriteInstallLog("REG\t%s\t%s", RootName, Path);
 	}
 }
 
@@ -145,29 +153,48 @@
 	FileName++;
 
 	//Register the two extensions
-	WriteRegistry(".hs" , "", HASKELL_HANDLER);
-	WriteRegistry(".lhs", "", HASKELL_HANDLER);
+	WriteRegistry(HKEY_CLASSES_ROOT, ".hs" , "", HASKELL_HANDLER);
+	WriteRegistry(HKEY_CLASSES_ROOT, ".lhs", "", HASKELL_HANDLER);
 
 	//Allow the user to create a template
-	WriteRegistry(".hs\\ShellNew", "FileName", "");
+	WriteRegistry(HKEY_CLASSES_ROOT, ".hs\\ShellNew", "FileName", "");
 
 
-	WriteRegistry(HASKELL_HANDLER,                 "", "Haskell Script");
+	WriteRegistry(HKEY_CLASSES_ROOT, HASKELL_HANDLER,                 "", "Haskell Script");
 	strcpy(FileName, PrimaryFile "\",1");
-	WriteRegistry(HASKELL_HANDLER "\\DefaultIcon", "", Buffer);
-	WriteRegistry(HASKELL_HANDLER "\\shell",       "", "");
+	WriteRegistry(HKEY_CLASSES_ROOT, HASKELL_HANDLER "\\DefaultIcon", "", Buffer);
+	WriteRegistry(HKEY_CLASSES_ROOT, HASKELL_HANDLER "\\shell",       "", "");
 
 	strcpy(FileName, PrimaryFile "\" \"%1\"");
-	WriteRegistry(HASKELL_HANDLER "\\shell\\Open",          "", "");
-	WriteRegistry(HASKELL_HANDLER "\\shell\\Open\\command", "", Buffer);
+	WriteRegistry(HKEY_CLASSES_ROOT, HASKELL_HANDLER "\\shell\\Open",          "", "");
+	WriteRegistry(HKEY_CLASSES_ROOT, HASKELL_HANDLER "\\shell\\Open\\command", "", Buffer);
 
 	strcpy(FileName, PrimaryFile "\" /edit \"%1\"");
-	WriteRegistry(HASKELL_HANDLER "\\shell\\Edit",          "", "");
-	WriteRegistry(HASKELL_HANDLER "\\shell\\Edit\\command", "", Buffer);
+	WriteRegistry(HKEY_CLASSES_ROOT, HASKELL_HANDLER "\\shell\\Edit",          "", "");
+	WriteRegistry(HKEY_CLASSES_ROOT, HASKELL_HANDLER "\\shell\\Edit\\command", "", Buffer);
 
 	return true;
 }
 
+void RegisterUninstall(HWND hDlg, char* Folder)
+{
+#define UNINSTALL_ENTRY "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" ProgramName "\\"
+
+	char Buffer[MyMaxPath];
+	Buffer[0] = '\"';
+	strcpy(&Buffer[1], Folder);
+	char* FileName = &Buffer[strlen(Folder)+1];
+	FileName[0] = '\\';
+	FileName++;
+
+	WriteRegistry(HKEY_LOCAL_MACHINE, UNINSTALL_ENTRY, "DisplayName", ProgramName);
+	strcpy(FileName, PrimaryFile "\",0");
+	WriteRegistry(HKEY_LOCAL_MACHINE, UNINSTALL_ENTRY, "DisplayIcon", Buffer);
+	strcpy(FileName, "uninstall.exe\""); 
+	WriteRegistry(HKEY_LOCAL_MACHINE, UNINSTALL_ENTRY, "UninstallString", Buffer);
+	WriteRegistry(HKEY_LOCAL_MACHINE, UNINSTALL_ENTRY, "Publisher", Publisher);
+	WriteRegistry(HKEY_LOCAL_MACHINE, UNINSTALL_ENTRY, "HelpLink", Website);
+}
 
 void GetProgramFiles(HWND hDlg, char* Buffer)
 {
Index: src/winhugs/installer/ShellCode.h
===================================================================
RCS file: /cvs/hugs98/src/winhugs/installer/ShellCode.h,v
retrieving revision 1.1
diff -u -r1.1 ShellCode.h
--- src/winhugs/installer/ShellCode.h	6 Oct 2005 11:18:43 -0000	1.1
+++ src/winhugs/installer/ShellCode.h	12 Oct 2005 12:54:47 -0000
@@ -8,3 +8,4 @@
 void Browse(HWND hDlg, HWND hText);
 void GetProgramFiles(HWND hDlg, char* Buffer);
 bool RegisterFiletypes(HWND hDlg, char* Folder);
+void RegisterUninstall(HWND hDlg, char* Folder);
Index: src/winhugs/installer/StartCode.cpp
===================================================================
RCS file: /cvs/hugs98/src/winhugs/installer/StartCode.cpp,v
retrieving revision 1.3
diff -u -r1.3 StartCode.cpp
--- src/winhugs/installer/StartCode.cpp	12 Oct 2005 12:35:21 -0000	1.3
+++ src/winhugs/installer/StartCode.cpp	12 Oct 2005 12:58:47 -0000
@@ -319,6 +319,7 @@
 		if (!RegisterFiletypes(hDlg, InstallTo))
 			ErrBox("Could not register file types");
 	}
+	RegisterUninstall(hDlg, InstallTo);
 	BufPos[-1] = '\\';
 
 	StopInstallLog(false);
