[commit] r2740 - in trunk: Install SDK/BON/Wizard SDK/BON/Wizard/Scripts/1033

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Mon Feb 5 11:28:57 CST 2018


Author: ksmyth
Date: Mon Feb  5 11:28:57 2018
New Revision: 2740

Log:
GME interpreter wizard: set x64 config. Visual Studio 2017

Added:
   trunk/SDK/BON/Wizard/setup15.js
Modified:
   trunk/Install/GME_SDK.wxs
   trunk/SDK/BON/Wizard/Scripts/1033/default.js

Modified: trunk/Install/GME_SDK.wxs
==============================================================================
--- trunk/Install/GME_SDK.wxs	Mon Feb  5 11:28:52 2018	(r2739)
+++ trunk/Install/GME_SDK.wxs	Mon Feb  5 11:28:57 2018	(r2740)
@@ -736,6 +736,7 @@
         <File Id="setup110.js" Name="setup11.js"  Source="..\SDK\BON\Wizard\setup11.js" />
         <File Id="setup12.js" Name="setup12.js"  Source="..\SDK\BON\Wizard\setup12.js" />
         <File Id="setup14.js" Name="setup14.js"  Source="..\SDK\BON\Wizard\setup14.js" />
+        <File Id="setup15.js" Name="setup15.js"  Source="..\SDK\BON\Wizard\setup15.js" />
       </Component>
 
       <Component Id="BONWizard1033Files" Guid="{3183F8EB-28B7-433A-B645-E8BB483F7021}" Directory="INSTALLDIR_SDK_BON_WIZARD_1033">

Modified: trunk/SDK/BON/Wizard/Scripts/1033/default.js
==============================================================================
--- trunk/SDK/BON/Wizard/Scripts/1033/default.js	Mon Feb  5 11:28:52 2018	(r2739)
+++ trunk/SDK/BON/Wizard/Scripts/1033/default.js	Mon Feb  5 11:28:57 2018	(r2740)
@@ -168,22 +168,29 @@
 function AddConfig100(proj, strProjectName)
 {
     AddConfig90(proj, strProjectName);
+
+    var configs = proj.Object.Configurations;
+    for (var n = 1; n <= configs.Count; n++) {
+        var config = configs(n);
+
+        if (config.ConfigurationName === "Debug") {
     
     // Differences between VS2010 and earlier
-    var config = proj.Object.Configurations('Debug');
     var MIDLTool = config.Tools('VCMIDLTool');
     MIDLTool.TypeLibraryName = "$(ProjectDir)%(FileName).tlb";
     if (dte.Version >= 12 ) {
         // http://blogs.msdn.com/b/vcblog/archive/2013/07/08/mfc-support-for-mbcs-deprecated-in-visual-studio-2013.aspx
         config.CharacterSet = charSetUNICODE;
     }
+        } else if (config.ConfigurationName === "Release") {
     
-    config = proj.Object.Configurations('Release');
     MIDLTool = config.Tools('VCMIDLTool');
     MIDLTool.TypeLibraryName = "$(ProjectDir)%(FileName).tlb";
     if (dte.Version >= 12 ) {
         config.CharacterSet = charSetUNICODE;
     }
+    }
+    }
 }
 
 function AddConfig90(proj, strProjectName)
@@ -191,12 +198,17 @@
 	try
 	{
 	    var framework = wizard.FindSymbol('COMPONENT_FRAMEWORK');
-	    
+	
+    var configs = proj.Object.Configurations;
+    for (var n = 1; n <= configs.Count; n++) {
+        var config = configs(n);
+
+        if (config.ConfigurationName === "Debug") {
+    
 	// --------------------------- DEBUG SETTINGS --------------------------- //
 	
 	    // DEBUG GENERAL SETTINGS
-		var config = proj.Object.Configurations('Debug');
-	
+
 		config.ConfigurationType = ConfigurationTypes.typeDynamicLibrary;
           config.useOfMfc = useOfMfc.useMfcDynamic;
           config.UseOfAtl = useOfAtl.useAtlDynamic
@@ -236,13 +248,13 @@
 		LinkTool.LinkIncremental = linkIncrementalType.linkIncrementalYes;
 		LinkTool.GenerateDebugInformation = "true";
 		LinkTool.SubSystem = subSystemOption.subSystemWindows;
-		LinkTool.TargetMachine = machineTypeOption.machineX86;
 		LinkTool.ModuleDefinitionFile = 'Component.def';
 		LinkTool.RegisterOutput = true;
+                } else if (config.ConfigurationName === "Release") {
+
 	// --------------------------- RELEASE SETTINGS --------------------------- //
         
         // RELEASE GENERAL SETTINGS
-		config = proj.Object.Configurations('Release');
 		
 		config.ConfigurationType = ConfigurationTypes.typeDynamicLibrary;
         config.useOfMfc = useOfMfc.useMfcDynamic;
@@ -282,9 +294,10 @@
 		LinkTool.LinkIncremental = linkIncrementalType.linkIncrementalNo;
 		LinkTool.GenerateDebugInformation = "true";
 		LinkTool.SubSystem = subSystemOption.subSystemWindows;
-		LinkTool.TargetMachine = machineTypeOption.machineX86;
 		LinkTool.ModuleDefinitionFile = 'Component.def';
 		LinkTool.RegisterOutput = true;
+        }
+        }
 	}
 	catch(e)
 	{

Added: trunk/SDK/BON/Wizard/setup15.js
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/SDK/BON/Wizard/setup15.js	Mon Feb  5 11:28:57 2018	(r2740)
@@ -0,0 +1,228 @@
+// GME Component Wizard Installer
+// Copyright (C) Vanderbilt University, ISIS
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//
+// This script is based on a similar installer for the WTL library.
+//
+// The use and distribution terms for this software are covered by the
+// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)
+// which can be found in the file CPL.TXT at the root of this distribution.
+// By using this software in any fashion, you are agreeing to be bound by
+// the terms of this license. You must not remove this notice, or
+// any other, from this software.
+
+
+main("15.0", "Visual Studio 2017");
+
+function main(vc_ver, vs_ver)
+{
+	var componentPrefixes = ['RawComponent', 'BONComponent', 'BON2Component'];
+	
+	// Decode command line arguments
+	var bDebug = false;
+	var bElevated = false;
+	var Args = WScript.Arguments;
+	for(var i = 0; i < Args.length; i++)
+	{
+		if(Args(i) == "/debug")
+			bDebug = true;
+		else if(Args(i) == "/elevated")
+			bElevated = true;
+	}
+
+	// See if UAC is enabled
+	var Shell = WScript.CreateObject("Shell.Application");
+	if(!bElevated && Shell.IsRestricted("System", "EnableLUA"))
+	{
+		// Check that the script is being run interactively.
+		if(!WScript.Interactive)
+		{
+			WScript.Echo("ERROR: Elevation required.");
+			return;
+		}
+		
+		// Now relaunch the script, using the "RunAs" verb to elevate
+		var strParams = "\"" + WScript.ScriptFullName + "\"";
+		if (bDebug)
+			strParams += " /debug";
+		strParams += " /elevated";
+		Shell.ShellExecute(WScript.FullName, strParams, null, "RunAs");
+		return;
+	}
+	
+	// Create shell object
+	var WSShell = WScript.CreateObject("WScript.Shell");
+	// Create file system object
+	var FileSys = WScript.CreateObject("Scripting.FileSystemObject");
+
+	// Get the folder containing the script file
+	var strValue = FileSys.GetParentFolderName(WScript.ScriptFullName);
+	if(strValue == null || strValue == "")
+		strValue = ".";
+
+	//var strSourceFolder = FileSys.BuildPath(strValue, "Files");
+	var strSourceFolder = strValue;
+	
+	if(bDebug)
+		WScript.Echo("Source: " + strSourceFolder);
+
+	if(!FileSys.FolderExists(strSourceFolder))
+	{
+		WScript.Echo("ERROR: Cannot find Wizard folder (should be: " + strSourceFolder + ")");
+		return;
+	}
+
+	try
+	{
+        var strVCKey = "HKLM\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\SxS\\VS7\\" + vc_ver;
+		strValue = WSShell.RegRead(strVCKey);
+	}
+	catch(e)
+	{
+        WScript.Echo("Cannot find where " + vs_ver + " is installed. UdmInterpreter wizard will be unavailable.");
+        return;
+	}
+    strValue = strValue + "Common7\\IDE\\VC\\";
+
+	var strDestFolder = FileSys.BuildPath(strValue, "vcprojects");
+	if(bDebug)
+		WScript.Echo("Destination: " + strDestFolder);
+	if(!FileSys.FolderExists(strDestFolder))
+	{
+		WScript.Echo("ERROR: Cannot find destination folder (should be: " + strDestFolder + ")");
+		return;
+	}
+
+	// Copy files
+	try
+	{
+		for (i in componentPrefixes) {
+			var strSrc = FileSys.BuildPath(strSourceFolder, componentPrefixes[i] + ".ico");
+			var strDest = FileSys.BuildPath(strDestFolder, componentPrefixes[i] + ".ico");
+		FileSys.CopyFile(strSrc, strDest);
+		}
+
+		strSrc = FileSys.BuildPath(strSourceFolder, "ComponentWizard.vsdir");
+		strDest = FileSys.BuildPath(strDestFolder, "ComponentWizard.vsdir");
+		FileSys.CopyFile(strSrc, strDest);
+	}
+	catch(e)
+	{
+		var strError = "no info";
+		if(e.description.length != 0)
+			strError = e.description;
+		WScript.Echo("ERROR: Cannot copy file (" + strError + ")");
+		return;
+	}
+
+	// Read and write *Component.vsz, add engine version and replace path when found
+	try
+	{
+		for (i in componentPrefixes) {
+			var strSrc = FileSys.BuildPath(strSourceFolder, componentPrefixes[i] + ".vsz");
+			var strDest = FileSys.BuildPath(strDestFolder, componentPrefixes[i] + ".vsz");
+
+		var ForReading = 1;
+		var fileSrc = FileSys.OpenTextFile(strSrc, ForReading);
+		if(fileSrc == null)
+		{
+			WScript.Echo("ERROR: Cannot open source file " + strSrc);
+			return;
+		}
+
+		var ForWriting = 2;
+		var fileDest = FileSys.OpenTextFile(strDest, ForWriting, true);
+		if(fileDest == null)
+		{
+			WScript.Echo("ERROR: Cannot open destination file" + strDest);
+			return;
+		}
+
+		while(!fileSrc.AtEndOfStream)
+		{
+			var strLine = fileSrc.ReadLine();
+			if(strLine.indexOf("Wizard=VsWizard.VsWizardEngine") != -1)
+				strLine = "Wizard=VsWizard.VsWizardEngine." + vc_ver;
+			else if(strLine.indexOf("WIZARD_VERSION") != -1)
+				strLine = "Param=\"WIZARD_VERSION = " + vc_ver + "\"";
+			else if(strLine.indexOf("ABSOLUTE_PATH") != -1)
+				strLine = "Param=\"ABSOLUTE_PATH = " + strSourceFolder + "\"";
+			fileDest.WriteLine(strLine);
+		}
+
+		fileSrc.Close();
+		fileDest.Close();
+	}
+	}
+	catch(e)
+	{
+		var strError = "no info";
+		if(e.description.length != 0)
+			strError = e.description;
+		WScript.Echo("ERROR: Cannot read and write wizard descriptor (*.vsz) (" + strError + ")");
+		return;
+	}
+
+	// Create GME folder
+	var strDestGMEFolder = "";
+	try
+	{
+		strDestGMEFolder = FileSys.BuildPath(strDestFolder, "GME");
+		if(!FileSys.FolderExists(strDestGMEFolder))
+			FileSys.CreateFolder(strDestGMEFolder);
+		if(bDebug)
+			WScript.Echo("GME Folder: " + strDestGMEFolder);
+	}
+	catch(e)
+	{
+		var strError = "no info";
+		if(e.description.length != 0)
+			strError = e.description;
+		WScript.Echo("ERROR: Cannot create GME folder (" + strError + ")");
+		return;
+	}
+
+	// Read and write additional ComponentWizard.vsdir, add path to the wizard location
+	try
+	{
+		var strSrc = FileSys.BuildPath(strSourceFolder, "ComponentWizard.vsdir");
+		var strDest = FileSys.BuildPath(strDestGMEFolder, "ComponentWizard.vsdir");
+
+		var ForReading = 1;
+		var fileSrc = FileSys.OpenTextFile(strSrc, ForReading);
+		if(fileSrc == null)
+		{
+			WScript.Echo("ERROR: Cannot open source file " + strSrc);
+			return;
+		}
+
+		var ForWriting = 2;
+		var fileDest = FileSys.OpenTextFile(strDest, ForWriting, true);
+		if(fileDest == null)
+		{
+			WScript.Echo("ERROR: Cannot open destination file" + strDest);
+			return;
+		}
+
+		while(!fileSrc.AtEndOfStream)
+		{
+			var strLine = fileSrc.ReadLine();
+			if(strLine.indexOf(".vsz|") != -1)
+				strLine = "..\\" + strLine;
+			fileDest.WriteLine(strLine);
+		}
+
+		fileSrc.Close();
+		fileDest.Close();
+	}
+	catch(e)
+	{
+		var strError = "no info";
+		if(e.description.length != 0)
+			strError = e.description;
+		WScript.Echo("ERROR: Cannot read and write GME\\ComponentWizard.vsdir (" + strError + ")");
+		return;
+	}
+
+	WScript.Echo("GME Component Wizard successfully installed!");
+}


More information about the gme-commit mailing list