Difference between revisions of "SDK - Tools - Command Line - Environment Variables (FSX/A)"

From FSDeveloper Wiki
Jump to: navigation, search
m (MS Cmd Here Powertoy)
m (Category - Removed inappropriate SimConnect)
 
(28 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{Infobox-Applicable-FSVersion
 
{{Infobox-Applicable-FSVersion
 +
| P3D2 = true
 +
| P3D = true
 
| FSXI = false
 
| FSXI = false
 
| FSXA = true
 
| FSXA = true
Line 7: Line 9:
 
| FS2000 = unknown
 
| FS2000 = unknown
 
| FS98 = unknown
 
| FS98 = unknown
 +
| XP10 = false
 +
| XP9 = false
 
}}
 
}}
 
A method to simplify working with the FSX/A SDK's command-line tools,
 
A method to simplify working with the FSX/A SDK's command-line tools,
 
<br>
 
<br>
by applying ''[http://en.wikipedia.org/wiki/Environment_variables environment variables]'', (a one-time operation).
+
which makes them available in any folder, on any drive,
 +
<br>
 +
by configuring ''[http://en.wikipedia.org/wiki/Environment_variables environment variables]'', (a one-time operation).
  
 
== Overview ==
 
== Overview ==
 +
 
=== Default Method ===
 
=== Default Method ===
 
Whilst you can drag a ''prepared file'' onto a desktop-shortcut to an SDK tool
 
Whilst you can drag a ''prepared file'' onto a desktop-shortcut to an SDK tool
Line 26: Line 33:
 
* You are unfamiliar with DOS command-line operations, (e.g. changing folders).
 
* You are unfamiliar with DOS command-line operations, (e.g. changing folders).
 
* You enter an incorrect path value.
 
* You enter an incorrect path value.
 +
 +
  
 
=== Environment Variables Method ===
 
=== Environment Variables Method ===
Line 37: Line 46:
 
* Works across drives.
 
* Works across drives.
 
* Output directly to the launching folder location,  or any chosen location.
 
* Output directly to the launching folder location,  or any chosen location.
* Ensure consistency and speed up your command-line entry.
+
* Ensure consistency and simplify/speed up your command-line entry.
 +
* Allow you to see any error messages
  
 
Each ''Environment variable'' comprises of a -
 
Each ''Environment variable'' comprises of a -
 
* '''Variable name''' - A label that you enter.  
 
* '''Variable name''' - A label that you enter.  
 
* '''Variable value''' - Whatever that label actually calls/does.
 
* '''Variable value''' - Whatever that label actually calls/does.
 +
 +
  
 
== SDK's Tools ==
 
== SDK's Tools ==
Line 51: Line 63:
 
* '''Simpropcompiler''' - Compiling XML gauges, autogen related files, & missions.
 
* '''Simpropcompiler''' - Compiling XML gauges, autogen related files, & missions.
  
== MS Cmd Here Powertoy ==
 
An automatic method, removing the need to navigate to your required directory/folder location.
 
<br>
 
See - [[Command_Prompt_Window#MS_Cmd_Here_Powertoy | MS Cmd Here Powertoy]]
 
  
== Operating System ==
 
Implementing by operating system -
 
  
=== XP ===
+
== Implementing ==
Implementing in XP.
+
Applicable to XP/Vista/Win7 operating systems -
 +
 
 
* Click Start -> Control Panel -> System
 
* Click Start -> Control Panel -> System
 
* A dialog box opens.
 
* A dialog box opens.
Line 67: Line 74:
 
* Click the button labeled ''Environment Variables''
 
* Click the button labeled ''Environment Variables''
 
* A dialog box opens.
 
* A dialog box opens.
 +
  
 
In the top section titled ''User Variables for <LOGIN-NAME>''
 
In the top section titled ''User Variables for <LOGIN-NAME>''
 
* Click the button labeled ''New''
 
* Click the button labeled ''New''
 
* A dialog box opens.
 
* A dialog box opens.
 +
  
 
Enter the -
 
Enter the -
* Variable name.
+
* '''Variable name'''.
* Variable value.
+
* '''Variable value'''.
 
* Click apply.
 
* Click apply.
 +
  
 
Repeat for any additional ''variable name/value'' pairs.
 
Repeat for any additional ''variable name/value'' pairs.
 +
  
 
Once finished adding the ''variable name/value'' pairs -
 
Once finished adding the ''variable name/value'' pairs -
 
* Click OK.
 
* Click OK.
 
* Click OK.
 
* Click OK.
 +
  
 
These ''environment variables'' will now be available in any subsequently launched '''Command Prompt Window''' session.
 
These ''environment variables'' will now be available in any subsequently launched '''Command Prompt Window''' session.
  
=== Vista ===
 
TODO - Add Vista specifics.
 
  
=== Windows 7 ===
+
 
TODO - Add Windows 7 specifics.
+
== FS2004 specific variables ==
 +
TODO - Add FS9 specific details.
 +
 
 +
 
  
 
== FSX/A specific variables ==
 
== FSX/A specific variables ==
These ''variable name/value'' pairs must be entered '''exactly''' as below, (N.B. some have quotes, some don't).
+
These ''variable name/value'' pairs must be entered '''exactly''' as below,  
 +
<br>
 +
(N.B. some utilise quotes, some don't).
  
 
The samples below are laid out as follows -
 
The samples below are laid out as follows -
 
<pre>
 
<pre>
 
variable name
 
variable name
 +
 
variable value
 
variable value
 
</pre>
 
</pre>
 +
  
 
=== FSX paths - Core ===
 
=== FSX paths - Core ===
 
Single-source ''base'' path variables '''essential''' for use in all ''tool'' variables.
 
Single-source ''base'' path variables '''essential''' for use in all ''tool'' variables.
To minimise -
+
<br>
 +
This approach has been adopted to minimise -
 
* configuration
 
* configuration
 
* possible path errors  
 
* possible path errors  
 
* path replication
 
* path replication
  
Examples below are for ''default installations''.
+
 
 +
 
 +
'''Two examples below are for ''default installations'''''.
 
<br>
 
<br>
 
If required, edit these paths to match your specific installation's locations
 
If required, edit these paths to match your specific installation's locations
Line 113: Line 133:
 
<pre>
 
<pre>
 
FSX_ROOT
 
FSX_ROOT
 +
 
C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\
 
C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\
 
</pre>
 
</pre>
Line 118: Line 139:
 
<pre>
 
<pre>
 
FSXSDK_ROOT
 
FSXSDK_ROOT
 +
 
C:\Program Files\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\
 
C:\Program Files\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\
 
</pre>
 
</pre>
 +
'''N.B.''' Trailing slash is essential.
 +
  
 
=== Tool Paths - Optional ===
 
=== Tool Paths - Optional ===
Line 126: Line 150:
 
''NB''  
 
''NB''  
 
<br>
 
<br>
The ''variable names'' I've used are identical to the actual tool's names, (to ease remembering).
+
Generally, the ''variable names'' I've used are identical to the actual tool's names, (to ease remembering).
 
<br>
 
<br>
 
<br>
 
<br>
Line 133: Line 157:
 
and must be entered '''exactly''' as below.
 
and must be entered '''exactly''' as below.
  
 +
 +
==== BGLComp ====
 
<pre>
 
<pre>
BGLComp
+
BGLCompX
 +
 
 
"%FSXSDK_ROOT%Environment Kit\BGL Compiler SDK\bglcomp.exe"
 
"%FSXSDK_ROOT%Environment Kit\BGL Compiler SDK\bglcomp.exe"
 
</pre>
 
</pre>
 +
Note the appended ''X'' suffix in the variable name,
 +
<br>
 +
allowing differentiation between FSX and FS9 bglcomp versions.
  
 +
 +
==== ImageTool ====
 
<pre>
 
<pre>
 
ImageTool
 
ImageTool
 +
 
"%FSXSDK_ROOT%Environment Kit\Terrain SDK\ImageTool.exe"
 
"%FSXSDK_ROOT%Environment Kit\Terrain SDK\ImageTool.exe"
 
</pre>
 
</pre>
  
 +
ImageTool will launch the GUI if no parameters are supplied.
 +
 +
 +
==== Resample ====
 
<pre>
 
<pre>
 
Resample
 
Resample
 +
 
"%FSXSDK_ROOT%Environment Kit\Terrain SDK\resample.exe"
 
"%FSXSDK_ROOT%Environment Kit\Terrain SDK\resample.exe"
 
</pre>
 
</pre>
  
 +
 +
==== Shp2Vec ====
 
<pre>
 
<pre>
 
Shp2Vec
 
Shp2Vec
 +
 
"%FSXSDK_ROOT%Environment Kit\Terrain SDK\Shp2Vec.exe"
 
"%FSXSDK_ROOT%Environment Kit\Terrain SDK\Shp2Vec.exe"
 
</pre>
 
</pre>
  
 +
Shp2Vec ''default method'' useage requires a path parameter.
 +
<br>
 +
i.e.
 +
<pre>Shp2Vec path string -flags</pre>
 +
 +
As the ''environment variable'' method is working in the context of the local folder,
 +
<br>
 +
just type a '''.''' to represent context of the local folder
 +
<br>
 +
i.e.
 +
<pre>Shp2Vec . string -flags</pre>
 +
 +
 +
==== Simpropcompiler ====
 
<pre>
 
<pre>
 
Simpropcompiler
 
Simpropcompiler
 +
 
"%FSXSDK_ROOT%Core Utilities Kit\SimProp\Simpropcompiler.exe"
 
"%FSXSDK_ROOT%Core Utilities Kit\SimProp\Simpropcompiler.exe"
 
</pre>
 
</pre>
  
=== Simpropcompiler - Optional ===
 
 
An extra for any frequent '''.SPB''' creators.
 
An extra for any frequent '''.SPB''' creators.
 
<pre>
 
<pre>
 
SPC2SPB
 
SPC2SPB
 +
 
%Simpropcompiler% 2spb -symbols "%FSX_ROOT%propdefs\*.xml"
 
%Simpropcompiler% 2spb -symbols "%FSX_ROOT%propdefs\*.xml"
 
</pre>
 
</pre>
 +
  
 
== Useage ==
 
== Useage ==
Line 172: Line 229:
 
* Right-click on that folder
 
* Right-click on that folder
 
* From the context-menu, left-click '''Open Command Window Here'''
 
* From the context-menu, left-click '''Open Command Window Here'''
 +
 +
 +
==== Windows 7 ====
 +
* Navigate to your project's ''data folder'', (whatever you're intending to process)
 +
* SHIFT + Right-click on that folder
 +
* From the context-menu, left-click '''Open Command Window Here'''
 +
  
 
=== Running ===
 
=== Running ===
Line 177: Line 241:
 
<br>
 
<br>
 
you must '''always''' wrap it in '''%''' characters.
 
you must '''always''' wrap it in '''%''' characters.
 +
  
 
==== Testing ====
 
==== Testing ====
Line 184: Line 249:
 
<br>
 
<br>
 
e.g.
 
e.g.
<pre>%bglcomp%</pre>
+
<pre>%bglcompx%</pre>
 
Pressing the return key, will now run bglcomp in the context of the local folder.
 
Pressing the return key, will now run bglcomp in the context of the local folder.
  
Line 190: Line 255:
 
<br>
 
<br>
 
the tool will prompt you with example parameters.
 
the tool will prompt you with example parameters.
 +
  
 
==== Normal ====
 
==== Normal ====
Line 196: Line 262:
 
type in a %variable_name% followed by any required parameters.
 
type in a %variable_name% followed by any required parameters.
 
<br>
 
<br>
e.g.
+
===== Example 1 =====
<pre>%BGLComp% yourproject.xml</pre>
+
<pre>%bglcompx% yourproject.xml</pre>
  
 
The output .bgl or .rwd will be in the current folder.
 
The output .bgl or .rwd will be in the current folder.
  
===== Notes =====
+
===== Example 2 =====
====== ImageTool ======
+
<pre>%spb2spc% yourproject.xml</pre>
ImageTool will launch the GUI if no parameters are supplied.
 
  
====== Shp2Vec ======
+
The output .spb will be in the current folder.
Shp2Vec ''default method'' useage requires a path parameter.
 
<br>
 
i.e.
 
<pre>Shp2Vec path string -flags</pre>
 
  
As the ''environment variable'' method is working in the context of the local folder,
 
<br>
 
just type a '''.''' to represent context of the local folder
 
<br>
 
i.e.
 
<pre>Shp2Vec . string -flags</pre>
 
  
 
== Related ==
 
== Related ==
 +
 
=== Internal ===
 
=== Internal ===
 
{{Template:Navbox-SDK (FSX)-Related}}
 
{{Template:Navbox-SDK (FSX)-Related}}
Line 228: Line 284:
 
[[Category:Scenery Design]]  
 
[[Category:Scenery Design]]  
 
[[Category:Missions]]  
 
[[Category:Missions]]  
[[Category:SimConnect]]
 
 
[[Category:Tools]]
 
[[Category:Tools]]

Latest revision as of 05:39, 29 June 2014

A method to simplify working with the FSX/A SDK's command-line tools,
which makes them available in any folder, on any drive,
by configuring environment variables, (a one-time operation).

Overview

Default Method

Whilst you can drag a prepared file onto a desktop-shortcut to an SDK tool
and that prepared file will then be processed by the tool,
sometimes things don't go as expected.

Using the command-line tools can be a little awkward,
particularly when -

  • Your source information, or data files contain errors.
  • You are unfamiliar with DOS command-line operations, (e.g. changing folders).
  • You enter an incorrect path value.


Environment Variables Method

Environment variables - Global values or settings, (available across sessions).
in this case, just think of it as a dynamic shortcut.

Once applied, these environment variables will -

  • Be available in any subsequently launched Command Prompt Window session.
  • Allow you to launch an SDK tool directly from any folder.
  • Works across drives.
  • Output directly to the launching folder location, or any chosen location.
  • Ensure consistency and simplify/speed up your command-line entry.
  • Allow you to see any error messages

Each Environment variable comprises of a -

  • Variable name - A label that you enter.
  • Variable value - Whatever that label actually calls/does.


SDK's Tools

List of FSX/A SDK's tools that utilise the Command Prompt Window, (aka DOS box).

  • BGLComp - Compiling scenery placement, airport data, & mission rewards
  • Resample - Compiling elevation, land/water class, photoscenery, etc. data.
  • Shp2Vec - Compiling vector data.
  • ImageTool - Imagery format conversion for simobjects & scenery.
  • Simpropcompiler - Compiling XML gauges, autogen related files, & missions.


Implementing

Applicable to XP/Vista/Win7 operating systems -

  • Click Start -> Control Panel -> System
  • A dialog box opens.
  • Click the tab titled Advanced
  • Click the button labeled Environment Variables
  • A dialog box opens.


In the top section titled User Variables for <LOGIN-NAME>

  • Click the button labeled New
  • A dialog box opens.


Enter the -

  • Variable name.
  • Variable value.
  • Click apply.


Repeat for any additional variable name/value pairs.


Once finished adding the variable name/value pairs -

  • Click OK.
  • Click OK.


These environment variables will now be available in any subsequently launched Command Prompt Window session.


FS2004 specific variables

TODO - Add FS9 specific details.


FSX/A specific variables

These variable name/value pairs must be entered exactly as below,
(N.B. some utilise quotes, some don't).

The samples below are laid out as follows -

variable name

variable value


FSX paths - Core

Single-source base path variables essential for use in all tool variables.
This approach has been adopted to minimise -

  • configuration
  • possible path errors
  • path replication


Two examples below are for default installations.
If required, edit these paths to match your specific installation's locations

FSX_ROOT

C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\
FSXSDK_ROOT

C:\Program Files\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\

N.B. Trailing slash is essential.


Tool Paths - Optional

Variables for calling the individual tools.

NB
Generally, the variable names I've used are identical to the actual tool's names, (to ease remembering).

The variable values rely on concatenating the tool paths
and must be entered exactly as below.


BGLComp

BGLCompX

"%FSXSDK_ROOT%Environment Kit\BGL Compiler SDK\bglcomp.exe"

Note the appended X suffix in the variable name,
allowing differentiation between FSX and FS9 bglcomp versions.


ImageTool

ImageTool

"%FSXSDK_ROOT%Environment Kit\Terrain SDK\ImageTool.exe"

ImageTool will launch the GUI if no parameters are supplied.


Resample

Resample

"%FSXSDK_ROOT%Environment Kit\Terrain SDK\resample.exe"


Shp2Vec

Shp2Vec

"%FSXSDK_ROOT%Environment Kit\Terrain SDK\Shp2Vec.exe"

Shp2Vec default method useage requires a path parameter.
i.e.

Shp2Vec path string -flags

As the environment variable method is working in the context of the local folder,
just type a . to represent context of the local folder
i.e.

Shp2Vec . string -flags


Simpropcompiler

Simpropcompiler

"%FSXSDK_ROOT%Core Utilities Kit\SimProp\Simpropcompiler.exe"

An extra for any frequent .SPB creators.

SPC2SPB

%Simpropcompiler% 2spb -symbols "%FSX_ROOT%propdefs\*.xml"


Useage

Opening

In explorer, (file manager) -

  • Navigate to your project's data folder, (whatever you're intending to process)
  • Right-click on that folder
  • From the context-menu, left-click Open Command Window Here


Windows 7

  • Navigate to your project's data folder, (whatever you're intending to process)
  • SHIFT + Right-click on that folder
  • From the context-menu, left-click Open Command Window Here


Running

As you are calling a variable
you must always wrap it in % characters.


Testing

For test purposes to prove its working,
type in a %variable_name% , (case insensitive) -
e.g.

%bglcompx%

Pressing the return key, will now run bglcomp in the context of the local folder.

As you've not supplied any parameters
the tool will prompt you with example parameters.


Normal

For normal useage
type in a %variable_name% followed by any required parameters.

Example 1
%bglcompx% yourproject.xml

The output .bgl or .rwd will be in the current folder.

Example 2
%spb2spc% yourproject.xml

The output .spb will be in the current folder.


Related

Internal

External

Placeholder text