[commit] r2739 - in trunk: Install SDK/DecoratorLib SDK/DecoratorWizard SDK/DecoratorWizard/Scripts/1033 SDK/DecoratorWizard/Templates/1033
GMESRC Repository Notifications
gme-commit at list.isis.vanderbilt.edu
Mon Feb 5 11:28:52 CST 2018
Author: ksmyth
Date: Mon Feb 5 11:28:52 2018
New Revision: 2739
Log:
DecoratorWizard: include DecoratorLib sources in vcxproj. Visual Studio 2012-2017 support. Set x64 config. UNICODE fixes
Added:
trunk/SDK/DecoratorWizard/Templates/1033/Common.inf
trunk/SDK/DecoratorWizard/setup11.js
trunk/SDK/DecoratorWizard/setup12.js
trunk/SDK/DecoratorWizard/setup14.js
trunk/SDK/DecoratorWizard/setup15.js
Modified:
trunk/Install/GME_SDK.wxs
trunk/SDK/DecoratorLib/ModelComplexPart.h
trunk/SDK/DecoratorWizard/Scripts/1033/default.js
trunk/SDK/DecoratorWizard/Templates/1033/DecoratorCompositePart.cpp
trunk/SDK/DecoratorWizard/Templates/1033/GMEOLEData.cpp
Modified: trunk/Install/GME_SDK.wxs
==============================================================================
--- trunk/Install/GME_SDK.wxs Mon Feb 5 11:28:40 2018 (r2738)
+++ trunk/Install/GME_SDK.wxs Mon Feb 5 11:28:52 2018 (r2739)
@@ -926,6 +926,10 @@
<File Id="DecoratorWizard.vsdir" Name="DecoratorWizard.vsdir" KeyPath="yes" Source="..\SDK\DecoratorWizard\DecoratorWizard.vsdir" />
<File Id="DecoratorWizard_default.vcproj" Name="default.vcproj" Source="..\SDK\DecoratorWizard\default.vcproj" />
<File Id="DecoratorWizard_setup100.js" Name="setup100.js" Source="..\SDK\DecoratorWizard\setup100.js" />
+ <File Id="DecoratorWizard_setup11.js" Name="setup11.js" Source="..\SDK\DecoratorWizard\setup11.js" />
+ <File Id="DecoratorWizard_setup12.js" Name="setup12.js" Source="..\SDK\DecoratorWizard\setup12.js" />
+ <File Id="DecoratorWizard_setup14.js" Name="setup14.js" Source="..\SDK\DecoratorWizard\setup14.js" />
+ <File Id="DecoratorWizard_setup15.js" Name="setup15.js" Source="..\SDK\DecoratorWizard\setup15.js" />
</Component>
<Component Id="DecoratorWizard1033Files" Guid="{FD5EDE74-DB08-4405-9FF8-DDDD23D0C4CE}" Directory="INSTALLDIR_SDK_DECORATOR_WIZARD_1033">
Modified: trunk/SDK/DecoratorLib/ModelComplexPart.h
==============================================================================
--- trunk/SDK/DecoratorLib/ModelComplexPart.h Mon Feb 5 11:28:40 2018 (r2738)
+++ trunk/SDK/DecoratorLib/ModelComplexPart.h Mon Feb 5 11:28:52 2018 (r2739)
@@ -14,6 +14,7 @@
#include <memory>
#include "TypeableBitmapPart.h"
#include "PortPart.h"
+#include <comdef.h>
namespace DecoratorSDK {
Modified: trunk/SDK/DecoratorWizard/Scripts/1033/default.js
==============================================================================
--- trunk/SDK/DecoratorWizard/Scripts/1033/default.js Mon Feb 5 11:28:40 2018 (r2738)
+++ trunk/SDK/DecoratorWizard/Scripts/1033/default.js Mon Feb 5 11:28:52 2018 (r2739)
@@ -2,11 +2,11 @@
{
try
{
- if (dte.Version == '10.0') {
- OnFinish100(selProj, selObj);
+ if (dte.Version == '9.0') {
+ OnFinish90(selProj, selObj);
}
else {
- OnFinish90(selProj, selObj);
+ OnFinish100(selProj, selObj);
}
}
catch(e)
@@ -26,14 +26,20 @@
selProj = CreateProject(strProjectName, strProjectPath);
+ // see C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCWizards\1033\common.js
AddCommonConfig(selProj, strProjectName);
AddConfig(selProj, strProjectName);
SetupFilters(selProj);
- var InfFile = CreateCustomInfFile();
+ var InfFile = CreateCustomInfFile('Templates.inf');
AddFilesToCustomProj(selProj, strProjectName, strProjectPath, InfFile);
AddDecoratorLibRc(selProj);
+
+ InfFile = CreateCustomInfFile('Common.inf');
+ var filter = selProj.Object.AddFilter("DecoratorLib");
+ AddCommonFilesToCustomProj(selProj, InfFile, filter);
+
PchSettings(selProj);
InfFile.Delete();
@@ -58,7 +64,7 @@
AddConfig(selProj, strProjectName);
AddFilters90(selProj);
- var InfFile = CreateCustomInfFile();
+ var InfFile = CreateCustomInfFile('Templates.inf');
AddFilesToCustomProj(selProj, strProjectName, strProjectPath, InfFile);
AddDecoratorLibRc(selProj);
PchSettings(selProj);
@@ -79,7 +85,7 @@
var strFile = '$(GME_ROOT)\\SDK\\DecoratorLib\\DecoratorLib.rc';
vcfile = proj.Object.AddFile(strFile);
- if (dte.Version != '10.0') {
+ if (dte.Version == '9.0') {
// This is needed to remove the '.' from the beginning of the relative path (added by default)
vcfile.RelativePath = strFile;
}
@@ -128,27 +134,6 @@
prj.Object.TargetFrameworkVersion = parseInt(fxtarget[0]) * 0x10000 + parseInt(fxtarget[1])
}
- // Add DecoratorLib Project to the Solution
- var wshShell = new ActiveXObject('WScript.Shell');
- var wshSysEnv = wshShell.Environment('SYSTEM');
- var gmeRoot = wshSysEnv('GME_ROOT');
- if (gmeRoot == '')
- {
- var wshUsrEnv = wshShell.Environment('USER');
- gmeRoot = wshSysEnv('GME_ROOT');
- }
- if (gmeRoot != '')
- {
- if (gmeRoot[gmeRoot.length - 1] != '\\' && gmeRoot[gmeRoot.length - 1] != '/')
- gmeRoot += '/';
- var decoratorLibPath = gmeRoot += 'SDK\\DecoratorLib\\DecoratorLib.vcproj';
- Solution.AddFromFile(decoratorLibPath, false);
- }
- else
- {
- // coudn't find GME_ROOT environment variable
- }
-
return prj;
}
catch(e)
@@ -181,19 +166,24 @@
{
try
{
- // --------------------------- DEBUG SETTINGS --------------------------- //
+
+ 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;
config.CharacterSet = charSet.charSetMBCS;
- if (dte.Version == '10.0') {
+ if (dte.Version != '9.0') {
var rule = config.Rules.Item("ConfigurationGeneral");
rule.SetPropertyValue("TargetName", "$(ProjectName)D");
- var PreBuild = config.Tools('VCPreBuildEventTool');
- PreBuild.CommandLine = "msbuild \"$(GME_ROOT)\\SDK\\DecoratorLib\\DecoratorLib.vcxproj\" /p:Configuration=$(Configuration) \"/p:SolutionDir=$(SolutionDir)\\\" /p:Platform=$(Platform)"
+ config.CharacterSet = charSet.charSetUNICODE;
}
// DEBUG MIDL SETTINGS
@@ -203,7 +193,7 @@
MIDLTool.ValidateParameters="true";
MIDLTool.TypeLibraryName = ".\\DecoratorLib.tlb";
MIDLTool.AdditionalIncludeDirectories = ".;$(GME_ROOT)\\SDK\\DecoratorLib;$(GME_ROOT)\\bin;$(GME_ROOT)\\Gme\\Release;$(GME_ROOT)\\Gme\\Debug;$(GME_ROOT)\\Gme\\Interfaces;$(GME_ROOT)\\Interfaces";
- if (dte.Version == '10.0')
+ if (dte.Version != '9.0')
MIDLTool.HeaderFileName = "%(Filename).h";
else
MIDLTool.HeaderFileName = "$(InputName).h";
@@ -227,27 +217,25 @@
// DEBUG LINKER SETTINGS
var LinkTool = config.Tools('VCLinkerTool');
- LinkTool.AdditionalDependencies = "gdiplus.lib DecoratorLibD.lib";
+ LinkTool.AdditionalDependencies = "gdiplus.lib";
LinkTool.AdditionalLibraryDirectories = "$(Configuration);$(SolutionDir)$(Configuration)";
LinkTool.LinkIncremental = linkIncrementalType.linkIncrementalYes;
LinkTool.GenerateDebugInformation = "true";
LinkTool.RegisterOutput = true;
LinkTool.SubSystem = subSystemOption.subSystemWindows;
LinkTool.ModuleDefinitionFile = 'DecoratorApp.def';
- if (dte.Version != '10.0')
+ if (dte.Version == '9.0')
LinkTool.OutputFile = "$(OutDir)\\$(ProjectName)D.dll"
// --------------------------- RELEASE SETTINGS --------------------------- //
-
+ } else if (config.ConfigurationName === "Release") {
// RELEASE GENERAL SETTINGS
- config = proj.Object.Configurations('Release');
config.ConfigurationType = ConfigurationTypes.typeDynamicLibrary;
config.useOfMfc = useOfMfc.useMfcDynamic;
config.useOfATL = useOfATL.useATLDynamic;
config.CharacterSet = charSet.charSetMBCS;
- if (dte.Version == '10.0') {
- var PreBuild = config.Tools('VCPreBuildEventTool');
- PreBuild.CommandLine = "msbuild \"$(GME_ROOT)\\SDK\\DecoratorLib\\DecoratorLib.vcxproj\" /p:Configuration=$(Configuration) \"/p:SolutionDir=$(SolutionDir)\\\" /p:Platform=$(Platform)"
+ if (dte.Version != '9.0') {
+ config.CharacterSet = charSet.charSetUNICODE;
}
// RELEASE MIDL SETTINGS
@@ -257,7 +245,7 @@
MIDLTool.ValidateParameters = "true";
MIDLTool.TypeLibraryName = ".\\DecoratorLib.tlb";
MIDLTool.AdditionalIncludeDirectories = ".;$(GME_ROOT)\\SDK\\DecoratorLib;$(GME_ROOT)\\bin;$(GME_ROOT)\\Gme\\Release;$(GME_ROOT)\\Gme\\Debug;$(GME_ROOT)\\Gme\\Interfaces;$(GME_ROOT)\\Interfaces";
- if (dte.Version == '10.0')
+ if (dte.Version != '9.0')
MIDLTool.HeaderFileName = "%(Filename).h";
else
MIDLTool.HeaderFileName = "$(InputName).h";
@@ -283,7 +271,7 @@
// RELASE LINKER SETTINGS
var LinkTool = config.Tools('VCLinkerTool');
- LinkTool.AdditionalDependencies = "gdiplus.lib DecoratorLib.lib";
+ LinkTool.AdditionalDependencies = "gdiplus.lib";
LinkTool.AdditionalLibraryDirectories = "$(Configuration);$(SolutionDir)$(Configuration)";
LinkTool.LinkIncremental = linkIncrementalType.linkIncrementalNo;
LinkTool.GenerateDebugInformation = "true";
@@ -292,6 +280,8 @@
LinkTool.RegisterOutput = true;
if (dte.Version != '10.0')
LinkTool.OutputFile = "$(OutDir)\\$(ProjectName).dll"
+ }
+ }
}
catch(e)
{
@@ -320,7 +310,7 @@
}
}
-function CreateCustomInfFile()
+function CreateCustomInfFile(infFileName)
{
try
{
@@ -334,7 +324,7 @@
var strWizTempFile = strTempFolder + "\\" + fso.GetTempName();
var strTemplatePath = wizard.FindSymbol('TEMPLATES_PATH');
- var strInfFile = strTemplatePath + '\\Templates.inf';
+ var strInfFile = strTemplatePath + '\\' + infFileName;
wizard.RenderTemplate(strInfFile, strWizTempFile);
var WizTempFile = fso.GetFile(strWizTempFile);
@@ -403,6 +393,41 @@
}
+function AddCommonFilesToCustomProj(proj, InfFile, proj)
+{
+ try
+ {
+
+ var strTextStream = InfFile.OpenAsTextStream(1, -2);
+ while (!strTextStream.AtEndOfStream)
+ {
+ strTpl = strTextStream.ReadLine();
+ if (strTpl != '' && strTpl != 'Stdafx.cpp')
+ {
+
+
+ var strFile = '$(GME_ROOT)\\SDK\\DecoratorLib\\' + strTpl;
+ vcfile = proj.AddFile(strFile);
+
+ if (dte.Version > 9 ) {
+
+ // This is needed to remove the '.' from the beginning of the relative path (added by default)
+ vcfile = '$(GME_ROOT)\\SDK\\SDK\\DecoratorLib\\' + strTpl;
+
+ }
+
+ }
+ }
+ strTextStream.Close();
+ }
+ catch(e)
+ {
+ throw e;
+ }
+}
+
+
+
// SIG // Begin signature block
// SIG // MIIj7gYJKoZIhvcNAQcCoIIj3zCCI9sCAQExCzAJBgUr
// SIG // DgMCGgUAMGcGCisGAQQBgjcCAQSgWTBXMDIGCisGAQQB
Added: trunk/SDK/DecoratorWizard/Templates/1033/Common.inf
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DecoratorWizard/Templates/1033/Common.inf Mon Feb 5 11:28:52 2018 (r2739)
@@ -0,0 +1,106 @@
+AtomBitmapPart.cpp
+AtomBitmapPart.h
+AttributePart.cpp
+AttributePart.h
+BitmapPart.cpp
+BitmapPart.h
+BitmapUtil.cpp
+BitmapUtil.h
+BoxCompositePart.cpp
+BoxCompositePart.h
+ClassComplexPart.cpp
+ClassComplexPart.h
+ClassLabelPart.cpp
+ClassLabelPart.h
+CompositePart.cpp
+CompositePart.h
+ConnectorVectorPart.cpp
+ConnectorVectorPart.h
+ConstraintFunctionVectorPart.cpp
+ConstraintFunctionVectorPart.h
+ConstraintVectorPart.cpp
+ConstraintVectorPart.h
+DIBRead.cpp
+DecoratorDefs.cpp
+DecoratorDefs.h
+DecoratorError.cpp
+DecoratorError.h
+DecoratorExceptions.cpp
+DecoratorExceptions.h
+DecoratorInterface.cpp
+DecoratorInterface.h
+DecoratorLibResource.h
+DecoratorMfc.cpp
+DecoratorMfc.h
+DecoratorSmart.cpp
+DecoratorSmart.h
+DecoratorUtil.cpp
+DecoratorUtil.h
+DialogTemplate.cpp
+DialogTemplate.h
+DiamondVectorPart.cpp
+DiamondVectorPart.h
+Dibapi.cpp
+EllipseVectorPart.cpp
+EllipseVectorPart.h
+GmeApi.h
+InPlaceEditDialog.cpp
+InPlaceEditDialog.h
+InheritanceVectorPart.cpp
+InheritanceVectorPart.h
+LabelPart.cpp
+LabelPart.h
+MaskedBitmapPart.cpp
+MaskedBitmapPart.h
+ModelComplexPart.cpp
+ModelComplexPart.h
+ModelSwitchButtonPart.cpp
+ModelSwitchButtonPart.h
+ModelSwitchPart.cpp
+ModelSwitchPart.h
+ModelTransparentPart.cpp
+ModelTransparentPart.h
+ObjectAndTextPart.cpp
+ObjectAndTextPart.h
+PartBase.cpp
+PartBase.h
+PartInterface.cpp
+PartInterface.h
+PathUtil.h
+PortBitmapPart.cpp
+PortBitmapPart.h
+PortLabelPart.cpp
+PortLabelPart.h
+PortPart.cpp
+PortPart.h
+PreferenceVariant.cpp
+PreferenceVariant.h
+ReferenceBitmapPart.cpp
+ReferenceBitmapPart.h
+ResizablePart.cpp
+ResizablePart.h
+ResizeLogic.cpp
+ResizeLogic.h
+SetBitmapPart.cpp
+SetBitmapPart.h
+SetSizeDialog.cpp
+SetSizeDialog.h
+SizeTrackerDialog.cpp
+SizeTrackerDialog.h
+Stdafx.cpp
+Stdafx.h
+StereoLabelPart.cpp
+StereoLabelPart.h
+TextPart.cpp
+TextPart.h
+TriangleVectorPart.cpp
+TriangleVectorPart.h
+TypeableBitmapPart.cpp
+TypeableBitmapPart.h
+TypeableLabelPart.cpp
+TypeableLabelPart.h
+VectorAndLabelPart.cpp
+VectorAndLabelPart.h
+VectorPart.cpp
+VectorPart.h
+targetver.h
Modified: trunk/SDK/DecoratorWizard/Templates/1033/DecoratorCompositePart.cpp
==============================================================================
--- trunk/SDK/DecoratorWizard/Templates/1033/DecoratorCompositePart.cpp Mon Feb 5 11:28:40 2018 (r2738)
+++ trunk/SDK/DecoratorWizard/Templates/1033/DecoratorCompositePart.cpp Mon Feb 5 11:28:52 2018 (r2739)
@@ -18,7 +18,7 @@
#include "DecoratorExceptions.h"
static const unsigned int CTX_MENU_ID_SAMPLE = DECORATOR_CTX_MENU_MINID + 100; // Should be unique
-static const char* CTX_MENU_STR_SAMPLE = "Decorator Ctx Menu Item";
+static const TCHAR* CTX_MENU_STR_SAMPLE = _T("Decorator Ctx Menu Item");
namespace Decor {
@@ -103,7 +103,7 @@
{
CRect ptRect = m_compositeParts[0]->GetBoxLocation();
if (ptRect.PtInRect(point)) {
- AfxMessageBox("Decorator double clicked!");
+ AfxMessageBox(_T("Decorator double clicked!"));
GeneralOperationStarted(NULL);
// TODO: do something
GeneralOperationFinished(NULL);
@@ -172,7 +172,7 @@
is_dir = (fstatus.st_mode & _S_IFDIR) == _S_IFDIR;
CString conn(szFileName);
- if (!is_dir && conn.Right(4).CompareNoCase(".txt") == 0) {
+ if (!is_dir && conn.Right(4).CompareNoCase(_T(".txt")) == 0) {
CFile txtFile(conn, CFile::modeRead);
char pbufRead[100];
UINT readLen = txtFile.Read(pbufRead, sizeof(pbufRead) - 1);
@@ -186,7 +186,7 @@
AfxMessageBox("Decorator drop: '.txt' files may be dropped only. Can't open file: " + conn + "!");
}
} else {
- AfxMessageBox("Decorator drop: Can't inquire file information!");
+ AfxMessageBox(_T("Decorator drop: Can't inquire file information!"));
}
}
@@ -196,7 +196,7 @@
bool DecoratorCompositePart::MenuItemSelected(UINT menuItemId, UINT nFlags, const CPoint& point, HDC transformHDC)
{
if (menuItemId == CTX_MENU_ID_SAMPLE) {
- AfxMessageBox("Decorator Ctx Menu Item clicked!");
+ AfxMessageBox(_T("Decorator Ctx Menu Item clicked!"));
GeneralOperationStarted(NULL);
// TODO: do something
GeneralOperationFinished(NULL);
Modified: trunk/SDK/DecoratorWizard/Templates/1033/GMEOLEData.cpp
==============================================================================
--- trunk/SDK/DecoratorWizard/Templates/1033/GMEOLEData.cpp Mon Feb 5 11:28:40 2018 (r2738)
+++ trunk/SDK/DecoratorWizard/Templates/1033/GMEOLEData.cpp Mon Feb 5 11:28:52 2018 (r2739)
@@ -322,11 +322,11 @@
CString desc;
COMTHROW( errinfo->GetDescription(PutOut(desc)) );
- AfxMessageBox(CString("Error while parsing XML file: ") + desc);
+ AfxMessageBox(CString(_T("Error while parsing XML file: ")) + desc);
}
catch(hresult_exception &)
{
- AfxMessageBox("Fatal error while parsing XML file!");
+ AfxMessageBox(_T("Fatal error while parsing XML file!"));
}
throw e;
Added: trunk/SDK/DecoratorWizard/setup11.js
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DecoratorWizard/setup11.js Mon Feb 5 11:28:52 2018 (r2739)
@@ -0,0 +1,229 @@
+// Decorator 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("11.0", "Visual Studio 2012");
+
+function main(vc_ver, vs_ver)
+{
+ // 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 strVC10Key = "HKLM\\Software\\Microsoft\\VisualStudio\\" + vc_ver + "\\Setup\\VC\\ProductDir";
+ strValue = WSShell.RegRead(strVC10Key);
+ }
+ catch(e)
+ {
+ try
+ {
+ var strVC10Key_x64 = "HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\" + vc_ver + "\\Setup\\VC\\ProductDir";
+ strValue = WSShell.RegRead(strVC10Key_x64);
+ }
+ catch(e)
+ {
+ WScript.Echo("ERROR: Cannot find where " + vs_ver + " is installed.");
+ 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, "Decorator.ico");
+ var strDest = FileSys.BuildPath(strDestFolder, "Decorator.ico");
+ FileSys.CopyFile(strSrc, strDest);
+
+ strSrc = FileSys.BuildPath(strSourceFolder, "DecoratorWizard.vsdir");
+ strDest = FileSys.BuildPath(strDestFolder, "DecoratorWizard.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 Decorator.vsz, add engine version and replace path when found
+ try
+ {
+ var strSrc = FileSys.BuildPath(strSourceFolder, "Decorator.vsz");
+ var strDest = FileSys.BuildPath(strDestFolder, "Decorator.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 (Decorator.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 DecoratorWizard.vsdir, add path to the wizard location
+ try
+ {
+ var strSrc = FileSys.BuildPath(strSourceFolder, "DecoratorWizard.vsdir");
+ var strDest = FileSys.BuildPath(strDestGMEFolder, "DecoratorWizard.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\\DecoratorWizard.vsdir (" + strError + ")");
+ return;
+ }
+
+ WScript.Echo("GME Component Wizard successfully installed!");
+}
Added: trunk/SDK/DecoratorWizard/setup12.js
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DecoratorWizard/setup12.js Mon Feb 5 11:28:52 2018 (r2739)
@@ -0,0 +1,229 @@
+// Decorator 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("12.0", "Visual Studio 2013");
+
+function main(vc_ver, vs_ver)
+{
+ // 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 strVC10Key = "HKLM\\Software\\Microsoft\\VisualStudio\\" + vc_ver + "\\Setup\\VC\\ProductDir";
+ strValue = WSShell.RegRead(strVC10Key);
+ }
+ catch(e)
+ {
+ try
+ {
+ var strVC10Key_x64 = "HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\" + vc_ver + "\\Setup\\VC\\ProductDir";
+ strValue = WSShell.RegRead(strVC10Key_x64);
+ }
+ catch(e)
+ {
+ WScript.Echo("ERROR: Cannot find where " + vs_ver + " is installed.");
+ 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, "Decorator.ico");
+ var strDest = FileSys.BuildPath(strDestFolder, "Decorator.ico");
+ FileSys.CopyFile(strSrc, strDest);
+
+ strSrc = FileSys.BuildPath(strSourceFolder, "DecoratorWizard.vsdir");
+ strDest = FileSys.BuildPath(strDestFolder, "DecoratorWizard.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 Decorator.vsz, add engine version and replace path when found
+ try
+ {
+ var strSrc = FileSys.BuildPath(strSourceFolder, "Decorator.vsz");
+ var strDest = FileSys.BuildPath(strDestFolder, "Decorator.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 (Decorator.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 DecoratorWizard.vsdir, add path to the wizard location
+ try
+ {
+ var strSrc = FileSys.BuildPath(strSourceFolder, "DecoratorWizard.vsdir");
+ var strDest = FileSys.BuildPath(strDestGMEFolder, "DecoratorWizard.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\\DecoratorWizard.vsdir (" + strError + ")");
+ return;
+ }
+
+ WScript.Echo("GME Component Wizard successfully installed!");
+}
Added: trunk/SDK/DecoratorWizard/setup14.js
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DecoratorWizard/setup14.js Mon Feb 5 11:28:52 2018 (r2739)
@@ -0,0 +1,229 @@
+// Decorator 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("14.0", "Visual Studio 2015");
+
+function main(vc_ver, vs_ver)
+{
+ // 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 strVC10Key = "HKLM\\Software\\Microsoft\\VisualStudio\\" + vc_ver + "\\Setup\\VC\\ProductDir";
+ strValue = WSShell.RegRead(strVC10Key);
+ }
+ catch(e)
+ {
+ try
+ {
+ var strVC10Key_x64 = "HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\" + vc_ver + "\\Setup\\VC\\ProductDir";
+ strValue = WSShell.RegRead(strVC10Key_x64);
+ }
+ catch(e)
+ {
+ WScript.Echo("ERROR: Cannot find where " + vs_ver + " is installed.");
+ 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, "Decorator.ico");
+ var strDest = FileSys.BuildPath(strDestFolder, "Decorator.ico");
+ FileSys.CopyFile(strSrc, strDest);
+
+ strSrc = FileSys.BuildPath(strSourceFolder, "DecoratorWizard.vsdir");
+ strDest = FileSys.BuildPath(strDestFolder, "DecoratorWizard.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 Decorator.vsz, add engine version and replace path when found
+ try
+ {
+ var strSrc = FileSys.BuildPath(strSourceFolder, "Decorator.vsz");
+ var strDest = FileSys.BuildPath(strDestFolder, "Decorator.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 (Decorator.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 DecoratorWizard.vsdir, add path to the wizard location
+ try
+ {
+ var strSrc = FileSys.BuildPath(strSourceFolder, "DecoratorWizard.vsdir");
+ var strDest = FileSys.BuildPath(strDestGMEFolder, "DecoratorWizard.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\\DecoratorWizard.vsdir (" + strError + ")");
+ return;
+ }
+
+ WScript.Echo("GME Component Wizard successfully installed!");
+}
Added: trunk/SDK/DecoratorWizard/setup15.js
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DecoratorWizard/setup15.js Mon Feb 5 11:28:52 2018 (r2739)
@@ -0,0 +1,230 @@
+// Decorator 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)
+{
+ // 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 strVC10Key = "HKLM\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\SxS\\VS7\\" + vc_ver;
+ strValue = WSShell.RegRead(strVC10Key);
+ }
+ catch(e)
+ {
+ try
+ {
+ var strVC10Key_x64 = "HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\" + vc_ver + "\\Setup\\VC\\ProductDir";
+ strValue = WSShell.RegRead(strVC10Key_x64);
+ }
+ catch(e)
+ {
+ WScript.Echo("ERROR: Cannot find where " + vs_ver + " is installed.");
+ 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
+ {
+ var strSrc = FileSys.BuildPath(strSourceFolder, "Decorator.ico");
+ var strDest = FileSys.BuildPath(strDestFolder, "Decorator.ico");
+ FileSys.CopyFile(strSrc, strDest);
+
+ strSrc = FileSys.BuildPath(strSourceFolder, "DecoratorWizard.vsdir");
+ strDest = FileSys.BuildPath(strDestFolder, "DecoratorWizard.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 Decorator.vsz, add engine version and replace path when found
+ try
+ {
+ var strSrc = FileSys.BuildPath(strSourceFolder, "Decorator.vsz");
+ var strDest = FileSys.BuildPath(strDestFolder, "Decorator.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 (Decorator.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 DecoratorWizard.vsdir, add path to the wizard location
+ try
+ {
+ var strSrc = FileSys.BuildPath(strSourceFolder, "DecoratorWizard.vsdir");
+ var strDest = FileSys.BuildPath(strDestGMEFolder, "DecoratorWizard.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\\DecoratorWizard.vsdir (" + strError + ")");
+ return;
+ }
+
+ WScript.Echo("GME Component Wizard successfully installed!");
+}
More information about the gme-commit
mailing list