From 45403833e9594302f31d608e2af53ca61dc79de3 Mon Sep 17 00:00:00 2001
From: Jeffrey Altman <jaltman@secure-endpoints.com>
Date: Fri, 17 Sep 2004 14:53:54 +0000
Subject: [PATCH] * kfw-fixed.nsi:    The version of MSIEXEC which ships with
 Windows 2000 does    not accept the /passive and /promptreboot command line  
  options.  On Windows 2000 only, do not specify them.

ticket: new
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16763 dc483132-0cff-0310-8789-dd5450dbe970
---
 src/windows/installer/nsis/ChangeLog     |  7 +++
 src/windows/installer/nsis/kfw-fixed.nsi | 56 ++++++++++++++++++++++++
 2 files changed, 63 insertions(+)

diff --git a/src/windows/installer/nsis/ChangeLog b/src/windows/installer/nsis/ChangeLog
index 3a0cd14b0..40d5e1ea3 100644
--- a/src/windows/installer/nsis/ChangeLog
+++ b/src/windows/installer/nsis/ChangeLog
@@ -1,3 +1,10 @@
+2004-09-17  Jeffrey Altman <jaltman@mit.edu>
+
+* kfw-fixed.nsi:
+   The version of MSIEXEC which ships with Windows 2000 does
+   not accept the /passive and /promptreboot command line
+   options.  On Windows 2000 only, do not specify them.
+
 2004-09-13  Jeffrey Altman <jaltman@mit.edu>
 
 * kfw-fixed.nsi:
diff --git a/src/windows/installer/nsis/kfw-fixed.nsi b/src/windows/installer/nsis/kfw-fixed.nsi
index 4253ba9c7..6847c82ce 100644
--- a/src/windows/installer/nsis/kfw-fixed.nsi
+++ b/src/windows/installer/nsis/kfw-fixed.nsi
@@ -667,6 +667,10 @@ testWIX:
   
 ;Run the uninstaller
 uninstMSI1:
+  Call GetWindowsVersion
+  Pop $R0
+  StrCmp $R0 "2000" uninstMSI1_2000
+
   ClearErrors
   ExecWait 'MSIEXEC /x{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A} /passive /promptrestart'
 
@@ -680,7 +684,22 @@ uninstMSI1:
   Call RestartRequired
   Pop $R1
   StrCmp $R1 "1" Restart DoNotRestart
+  
+uninstMSI1_2000:
+  ClearErrors
+  ExecWait 'MSIEXEC /x{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A}'
+
+  IfErrors no_remove_uninstaller
+    ;You can either use Delete /REBOOTOK in the uninstaller or add some code
+    ;here to remove the uninstaller. Use a registry key to check
+    ;whether the user has chosen to uninstall. If you are using an uninstaller
+    ;components page, make sure all sections are uninstalled.
 
+  Push $R1
+  Call RestartRequired
+  Pop $R1
+  StrCmp $R1 "1" Restart DoNotRestart
+  
 testSWRT:
   ClearErrors
   ReadRegStr $R0 HKLM \
@@ -696,6 +715,10 @@ testSWRT:
   
 ;Run the uninstaller
 uninstMSI2:
+  Call GetWindowsVersion
+  Pop $R0
+  StrCmp $R0 "2000" uninstMSI2_2000
+
   ClearErrors
   ExecWait 'MSIEXEC /x{61211594-AAA1-4A98-A299-757326763CC7} /passive /promptrestart'
 
@@ -710,6 +733,21 @@ uninstMSI2:
   Pop $R1
   StrCmp $R1 "1" Restart DoNotRestart
 
+uninstMSI2_2000:
+  ClearErrors
+  ExecWait 'MSIEXEC /x{61211594-AAA1-4A98-A299-757326763CC7}'
+
+  IfErrors no_remove_uninstaller
+    ;You can either use Delete /REBOOTOK in the uninstaller or add some code
+    ;here to remove the uninstaller. Use a registry key to check
+    ;whether the user has chosen to uninstall. If you are using an uninstaller
+    ;components page, make sure all sections are uninstalled.
+
+  Push $R1
+  Call RestartRequired
+  Pop $R1
+  StrCmp $R1 "1" Restart DoNotRestart
+
 testPismere:
   ClearErrors
   ReadRegStr $R0 HKLM \
@@ -725,6 +763,10 @@ testPismere:
   
 ;Run the uninstaller
 uninstPismere:
+  Call GetWindowsVersion
+  Pop $R0
+  StrCmp $R0 "2000" uninstPismere_2000
+
   ClearErrors
   ExecWait 'MSIEXEC /x{83977767-388D-4DF8-BB08-3BF2401635BD} /passive /promptrestart'
 
@@ -739,6 +781,20 @@ uninstPismere:
   Pop $R1
   StrCmp $R1 "1" Restart DoNotRestart
 
+uninstPismere_2000:
+  ClearErrors
+  ExecWait 'MSIEXEC /x{83977767-388D-4DF8-BB08-3BF2401635BD}'
+
+  IfErrors no_remove_uninstaller
+    ;You can either use Delete /REBOOTOK in the uninstaller or add some code
+    ;here to remove the uninstaller. Use a registry key to check
+    ;whether the user has chosen to uninstall. If you are using an uninstaller
+    ;components page, make sure all sections are uninstalled.
+
+  Push $R1
+  Call RestartRequired
+  Pop $R1
+  StrCmp $R1 "1" Restart DoNotRestart
 
 
 Restart:
-- 
2.26.2