From 35f7a0b916d71d4ba15e4b7aacdb38bdc352af8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Sat, 4 Dec 2004 17:44:46 +0100
Subject: [PATCH] Forward ported wix updates from Pike 7.4.

Rev: bin/install.pike:1.153
Rev: src/Makefile.in:1.395
---
 bin/install.pike | 48 +++++++++++++++++++++++-------------------------
 src/Makefile.in  | 13 ++++++++++++-
 2 files changed, 35 insertions(+), 26 deletions(-)

diff --git a/bin/install.pike b/bin/install.pike
index 24b076d7f1..6873bdb8cc 100644
--- a/bin/install.pike
+++ b/bin/install.pike
@@ -2,7 +2,7 @@
 
 // Pike installer and exporter.
 //
-// $Id: install.pike,v 1.152 2004/11/30 15:46:30 grubba Exp $
+// $Id: install.pike,v 1.153 2004/12/04 16:41:19 grubba Exp $
 
 #define USE_GTK
 
@@ -1064,8 +1064,13 @@ void do_export()
     // Clean up dumped files and modules on uninstall.
     recurse_uninstall_file(root->sub_dirs["lib"], "*.o");
 
-    // Make sure the kludge directory exists (forward compat).
-    root->extra_ids["KLUDGE_TARGETDIR"] = 1;
+    // We need to have a unique name for the TARGETDIR
+    // due to light not rewriting [TARGETDIR] in the
+    // property custom action below.
+    //
+    // Note: The directory we get merged into must also have
+    //       this id as long as the bug exists.
+    root->extra_ids["PIKE_TARGETDIR"] = 1;
 
     // Generate the XML directory tree.
     WixNode xml_root =
@@ -1079,40 +1084,33 @@ void do_export()
 
     module_node->
       add_child(WixNode("CustomAction", ([
-			  "Id":"FinalizePike",
-			  // Note: Need to use the kludge directory here
-			  //       rather than the root directory due to
-			  //       bugs in light.
-			  //	/grubba 2004-11-08
-			  "Directory":"KLUDGE_TARGETDIR",
-			  "Execute":"deferred",
-			  "ExeCommand":"[KLUDGE_TARGETDIR]\\bin\\pike "
-			  "-mlib\\master.pike bin\\install.pike "
-			  "--finalize BASEDIR=. TMP_BUILDDIR=bin",
+			  "Id":"SetFinalizePike",
+			  "Property":"FinalizePike",
+			  "Value":"[PIKE_TARGETDIR]",
+			  "Execute":"immediate",
 			])))->
       add_child(Standards.XML.Wix.line_feed)->
       add_child(WixNode("CustomAction", ([
-			  "Id":"InstallMaster",
-			  // Note: Need to use the kludge directory here
-			  //       rather than the root directory due to
-			  //       bugs in light.
-			  //	/grubba 2004-11-08
-			  "Directory":"KLUDGE_TARGETDIR",
+			  "Id":"FinalizePike",
+			  "BinaryKey":"PikeInstaller",
+			  "VBScriptCall":"FinalizePike",
 			  "Execute":"deferred",
-			  "ExeCommand":"[KLUDGE_TARGETDIR]\\bin\\pike "
-			  "-mlib\\master.pike bin\\install.pike "
-			  "--install-master BASEDIR=.",
+			])))->
+      add_child(Standards.XML.Wix.line_feed)->
+      add_child(WixNode("Binary", ([
+			  "Id":"PikeInstaller",
+			  "src":"PikeWin32Installer.vbs",
 			])))->
       add_child(Standards.XML.Wix.line_feed)->
       add_child(WixNode("InstallExecuteSequence", ([]), "\n")->
 		add_child(WixNode("Custom", ([
-				    "Action":"FinalizePike",
+				    "Action":"SetFinalizePike",
 				    "After":"WriteRegistryValues",
 				  ]), "REMOVE=\"\""))->
 		add_child(Standards.XML.Wix.line_feed)->
 		add_child(WixNode("Custom", ([
-				    "Action":"InstallMaster",
-				    "After":"FinalizePike",
+				    "Action":"FinalizePike",
+				    "After":"SetFinalizePike",
 				  ]), "REMOVE=\"\""))->
 		add_child(Standards.XML.Wix.line_feed))->
       add_child(Standards.XML.Wix.line_feed);
diff --git a/src/Makefile.in b/src/Makefile.in
index 958c0ee2f0..088d0ced87 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.in,v 1.394 2004/11/24 10:22:15 mast Exp $
+# $Id: Makefile.in,v 1.395 2004/12/04 16:44:46 grubba Exp $
 #
 
 # This line is needed on some machines.
@@ -28,6 +28,7 @@ DOCDIR = @DOCDIR@
 MANDIR_SRC = @MANDIR@
 DOCDIR_SRC = @DOCDIR@
 BASEDIR = @BASEDIR@
+PACKAGINGDIR = $(SRCDIR)/../packaging
 
 # These are used by the files generated by fixdepends.sh
 PIKE_SRC_DIR=$(SRCDIR)
@@ -444,6 +445,16 @@ undump_modules: delete_dumped_modules
 Pike_banner.bmp: $(SRCDIR)/make_banner.pike $(SRCDIR)/../refdoc/src_images/pike_logo.gif
 	$(RUNPIKE) $(SRCDIR)/make_banner.pike $(SRCDIR)/../refdoc/src_images/pike_logo.gif >Pike_banner.bmp || rm Pike_banner.bmp
 
+PikeWin32Installer.vbs: $(PACKAGINGDIR)/windows/installer.vbs
+	@if [ -f "$@" ] && cmp "$<" "$@" >/dev/null; then \
+	  echo "PikeWin32Installer.vbs is up to date."; \
+	else \
+	  echo cp '"'"$<"'"' '"'"$@"'"'; \
+	  cp "$<" "$@"; \
+	fi
+
+Pike_module.msm: PikeWin32Installer.vbs
+
 Pike_module.wxs: force
 	@no_autodoc="--no-autodoc"; \
 	if [ -f autodoc.xml ]; then no_autodoc=""; fi; \
-- 
GitLab