[Mobies-commit] [commit] r4357 - in UDM/trunk/src/UIntWizVS: . Scripts/1033
daniel at redhat3.isis.vanderbilt.edu
daniel at redhat3.isis.vanderbilt.edu
Fri Jan 23 13:37:32 CST 2015
Author: daniel
Date: Fri Jan 23 13:37:32 2015
New Revision: 4357
Log:
Added UIntWiz support for Visual Studio 2013 (12.0).
Added:
UDM/trunk/src/UIntWizVS/setup120.js
Modified:
UDM/trunk/src/UIntWizVS/Scripts/1033/default.js
Modified: UDM/trunk/src/UIntWizVS/Scripts/1033/default.js
==============================================================================
--- UDM/trunk/src/UIntWizVS/Scripts/1033/default.js Thu Jan 22 09:21:03 2015 (r4356)
+++ UDM/trunk/src/UIntWizVS/Scripts/1033/default.js Fri Jan 23 13:37:32 2015 (r4357)
@@ -1,11 +1,15 @@
function OnFinish(selProj, selObj)
-{
- try
- {
- if (dte.Version == '10.0') {
- OnFinish100(selProj, selObj);
- }
- else {
+{
+ try
+ {
+ if (dte.Version == '12.0') {
+ // reuse OnFinish100 function
+ OnFinish100(selProj, selObj);
+ }
+ else if (dte.Version == '10.0') {
+ OnFinish100(selProj, selObj);
+ }
+ else {
OnFinish90(selProj, selObj);
}
}
@@ -237,24 +241,24 @@
// DEBUG GENERAL SETTINGS
var config = proj.Object.Configurations('Debug');
- config.ConfigurationType = ConfigurationTypes.typeDynamicLibrary;
- config.useOfMfc = useOfMfc.useMfcDynamic;
- config.CharacterSet = charSet.charSetMBCS;
- if (dte.Version == '10.0') {
- var rule = config.Rules.Item("ConfigurationGeneral");
- rule.SetPropertyValue("TargetName", "$(ProjectName)D");
- }
+ config.ConfigurationType = ConfigurationTypes.typeDynamicLibrary;
+ config.useOfMfc = useOfMfc.useMfcDynamic;
+ config.CharacterSet = charSet.charSetMBCS;
+ if (dte.Version == '10.0' || dte.Version == '12.0') {
+ var rule = config.Rules.Item("ConfigurationGeneral");
+ rule.SetPropertyValue("TargetName", "$(ProjectName)D");
+ }
// DEBUG MIDL SETTINGS
var MIDLTool = config.Tools('VCMIDLTool');
MIDLTool.PreprocessorDefinitions="_DEBUG";
- MIDLTool.MkTypLibCompatible="false";
- MIDLTool.ValidateParameters="true";
- MIDLTool.TypeLibraryName = ".\\ComponentLib.tlb";
- if (dte.Version == '10.0')
- MIDLTool.HeaderFileName = "%(Filename).h";
- else
- MIDLTool.HeaderFileName = "$(InputName).h";
+ MIDLTool.MkTypLibCompatible="false";
+ MIDLTool.ValidateParameters="true";
+ MIDLTool.TypeLibraryName = ".\\ComponentLib.tlb";
+ if (dte.Version == '10.0' || dte.Version == '12.0')
+ MIDLTool.HeaderFileName = "%(Filename).h";
+ else
+ MIDLTool.HeaderFileName = "$(InputName).h";
MIDLTool.AdditionalIncludeDirectories = ".;$(GME_ROOT)\\Interfaces;$(GME_ROOT)\\Gme\\Interfaces;$(GME_ROOT)\\bin;$(GME_ROOT)\\Gme\\Release;$(GME_ROOT)\\Gme\\Debug";
// DEBUG COMPILER SETTINGS
@@ -279,13 +283,13 @@
var LinkTool = config.Tools('VCLinkerTool');
LinkTool.LinkIncremental = linkIncrementalType.linkIncrementalYes;
LinkTool.GenerateDebugInformation = "true";
- LinkTool.SubSystem = subSystemOption.subSystemWindows;
- LinkTool.ModuleDefinitionFile = 'Component.def';
- LinkTool.RegisterOutput = true;
- if (dte.Version != '10.0')
- LinkTool.OutputFile = "$(OutDir)/$(ProjectName)D.dll"
- LinkTool.AdditionalLibraryDirectories = ".;$(UDM_PATH)\\lib";
-
+ LinkTool.SubSystem = subSystemOption.subSystemWindows;
+ LinkTool.ModuleDefinitionFile = 'Component.def';
+ LinkTool.RegisterOutput = true;
+ if (dte.Version != '10.0' && dte.Version != '12.0')
+ LinkTool.OutputFile = "$(OutDir)/$(ProjectName)D.dll"
+ LinkTool.AdditionalLibraryDirectories = ".;$(UDM_PATH)\\lib";
+
if(wizard.FindSymbol("UDM_LINKING_STATIC"))
{
LinkTool.AdditionalDependencies = "UmlD.lib UdmBaseD.lib UdmDomD.lib UdmGmeD.lib UdmUtilD.lib Xerces-c_2D.lib zlibD.lib";
@@ -308,13 +312,13 @@
// RELEASE MIDL SETTINGS
var MIDLTool = config.Tools('VCMIDLTool');
MIDLTool.PreprocessorDefinitions = "NDEBUG";
- MIDLTool.MkTypLibCompatible = "false";
- MIDLTool.ValidateParameters = "true";
- MIDLTool.TypeLibraryName = ".\\ComponentLib.tlb";
- if (dte.Version == '10.0')
- MIDLTool.HeaderFileName = "%(Filename).h";
- else
- MIDLTool.HeaderFileName = "$(InputName).h";
+ MIDLTool.MkTypLibCompatible = "false";
+ MIDLTool.ValidateParameters = "true";
+ MIDLTool.TypeLibraryName = ".\\ComponentLib.tlb";
+ if (dte.Version == '10.0' || dte.Version == '12.0')
+ MIDLTool.HeaderFileName = "%(Filename).h";
+ else
+ MIDLTool.HeaderFileName = "$(InputName).h";
MIDLTool.PreprocessorDefinitions="_DEBUG";
MIDLTool.AdditionalIncludeDirectories = ".;$(GME_ROOT)\\Interfaces;$(GME_ROOT)\\Gme\\Interfaces;$(GME_ROOT)\\bin;$(GME_ROOT)\\Gme\\Release;$(GME_ROOT)\\Gme\\Debug";
@@ -339,13 +343,13 @@
var LinkTool = config.Tools('VCLinkerTool');
LinkTool.LinkIncremental = linkIncrementalType.linkIncrementalNo;
LinkTool.GenerateDebugInformation = "true";
- LinkTool.SubSystem = subSystemOption.subSystemWindows;
- LinkTool.ModuleDefinitionFile = 'Component.def';
- LinkTool.RegisterOutput = true;
- if (dte.Version != '10.0')
- LinkTool.OutputFile = "$(OutDir)/$(ProjectName).dll"
- LinkTool.AdditionalLibraryDirectories = ".;$(UDM_PATH)\\lib";
-
+ LinkTool.SubSystem = subSystemOption.subSystemWindows;
+ LinkTool.ModuleDefinitionFile = 'Component.def';
+ LinkTool.RegisterOutput = true;
+ if (dte.Version != '10.0' && dte.Version != '12.0')
+ LinkTool.OutputFile = "$(OutDir)/$(ProjectName).dll"
+ LinkTool.AdditionalLibraryDirectories = ".;$(UDM_PATH)\\lib";
+
if(wizard.FindSymbol("UDM_LINKING_STATIC"))
{
LinkTool.AdditionalDependencies = "Uml.lib UdmBase.lib UdmDom.lib UdmGme.lib UdmUtil.lib Xerces-c_2.lib zlib.lib";
@@ -518,13 +522,13 @@
strTpl = strTextStream.ReadLine();
if (strTpl != '')
{
- var strFile = '$(GME_ROOT)\\SDK\\BON\\Common\\' + strTpl;
- vcfile = proj.Object.AddFile(strFile);
-
- if (dte.Version != '10.0') {
- // This is needed to remove the '.' from the beginning of the relative path (added by default)
- vcfile.RelativePath = '$(GME_ROOT)\\SDK\\BON\\Common\\' + strTpl;
- }
+ var strFile = '$(GME_ROOT)\\SDK\\BON\\Common\\' + strTpl;
+ vcfile = proj.Object.AddFile(strFile);
+
+ if (dte.Version != '10.0' && dte.Version != '12.0') {
+ // This is needed to remove the '.' from the beginning of the relative path (added by default)
+ vcfile.RelativePath = '$(GME_ROOT)\\SDK\\BON\\Common\\' + strTpl;
+ }
}
}
strTextStream.Close();
Added: UDM/trunk/src/UIntWizVS/setup120.js
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ UDM/trunk/src/UIntWizVS/setup120.js Fri Jan 23 13:37:32 2015 (r4357)
@@ -0,0 +1,241 @@
+// UDM Interpreter 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.
+
+// Setup program for the UDM Interpreter Wizard for VC++ 12.0 (Visual Studio 2013)
+
+
+main();
+
+function main()
+{
+ // 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\\Microsoft\\VisualStudio\\12.0\\Setup\\VC\\ProductDir";
+ strValue = WSShell.RegRead(strVCKey);
+ }
+ catch(e)
+ {
+ try
+ {
+ var strVCKey_x64 = "HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\12.0\\Setup\\VC\\ProductDir";
+ strValue = WSShell.RegRead(strVCKey_x64);
+ }
+ catch(e)
+ {
+ try
+ {
+ var strVCExKey = "HKLM\\Software\\Microsoft\\VCExpress\\12.0\\Setup\\VC\\ProductDir";
+ strValue = WSShell.RegRead(strVCExKey);
+ }
+ catch(e)
+ {
+ WScript.Echo("Cannot find where Visual Studio 2010 is installed. UdmInterpreter wizard will be unavailable.");
+ return;
+ }
+ WScript.Echo("Visual Studio Express doesn't support Wizards. UdmInterpreter Wizard will be unavailable.");
+ return;
+ }
+ }
+
+ 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
+ {
+ var strSrc = FileSys.BuildPath(strSourceFolder, "UDMInterpreter.ico");
+ var strDest = FileSys.BuildPath(strDestFolder, "UDMInterpreter.ico");
+ FileSys.CopyFile(strSrc, strDest);
+
+ strSrc = FileSys.BuildPath(strSourceFolder, "UDMInterpreterWizard.vsdir");
+ strDest = FileSys.BuildPath(strDestFolder, "UDMInterpreterWizard.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 UDMInterpreter.vsz, add engine version and replace path when found
+ try
+ {
+ var strSrc = FileSys.BuildPath(strSourceFolder, "UDMInterpreter.vsz");
+ var strDest = FileSys.BuildPath(strDestFolder, "UDMInterpreter.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.12.0";
+ else if(strLine.indexOf("WIZARD_VERSION") != -1)
+ strLine = "Param=\"WIZARD_VERSION = 12.0\"";
+ 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 (UDMInterpreter.vsz) (" + strError + ")");
+ return;
+ }
+
+ // Create UDM folder
+ var strDestGMEFolder = "";
+ try
+ {
+ strDestGMEFolder = FileSys.BuildPath(strDestFolder, "UDM");
+ 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 UDMInterpreterWizard.vsdir, add path to the wizard location
+ try
+ {
+ var strSrc = FileSys.BuildPath(strSourceFolder, "UDMInterpreterWizard.vsdir");
+ var strDest = FileSys.BuildPath(strDestGMEFolder, "UDMInterpreterWizard.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\\UDMInterpreterWizard.vsdir (" + strError + ")");
+ return;
+ }
+
+// WScript.Echo("UDM Interpreter Wizard successfully installed!");
+}
More information about the Mobies-commit
mailing list