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

From FSDeveloper Wiki
Jump to: navigation, search
m
m (Category - Removed inappropriate SimConnect)
 
(11 intermediate revisions by 2 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>
 +
which makes them available in any folder, on any drive,
 
<br>
 
<br>
 
by configuring ''[http://en.wikipedia.org/wiki/Environment_variables environment variables]'', (a one-time operation).
 
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 43: Line 52:
 
* '''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 52: Line 63:
 
* '''Simpropcompiler''' - Compiling XML gauges, autogen related files, & missions.
 
* '''Simpropcompiler''' - Compiling XML gauges, autogen related files, & missions.
  
== Operating System ==
+
 
 +
 
 +
== Implementing ==
 
Applicable to XP/Vista/Win7 operating systems -
 
Applicable to XP/Vista/Win7 operating systems -
  
Line 61: 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.
 +
 +
 +
 +
== FS2004 specific variables ==
 +
TODO - Add FS9 specific details.
  
  
Line 92: Line 115:
 
variable value
 
variable value
 
</pre>
 
</pre>
 +
  
 
=== FSX paths - Core ===
 
=== FSX paths - Core ===
Line 101: Line 125:
 
* 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 116: Line 142:
 
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 122: 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 128: Line 156:
 
<br>
 
<br>
 
and must be entered '''exactly''' as below.
 
and must be entered '''exactly''' as below.
 +
  
 
==== BGLComp ====
 
==== BGLComp ====
Line 138: Line 167:
 
<br>
 
<br>
 
allowing differentiation between FSX and FS9 bglcomp versions.
 
allowing differentiation between FSX and FS9 bglcomp versions.
 +
  
 
==== ImageTool ====
 
==== ImageTool ====
Line 147: Line 177:
  
 
ImageTool will launch the GUI if no parameters are supplied.
 
ImageTool will launch the GUI if no parameters are supplied.
 +
  
 
==== Resample ====
 
==== Resample ====
Line 154: Line 185:
 
"%FSXSDK_ROOT%Environment Kit\Terrain SDK\resample.exe"
 
"%FSXSDK_ROOT%Environment Kit\Terrain SDK\resample.exe"
 
</pre>
 
</pre>
 +
  
 
==== Shp2Vec ====
 
==== Shp2Vec ====
Line 173: Line 205:
 
i.e.
 
i.e.
 
<pre>Shp2Vec . string -flags</pre>
 
<pre>Shp2Vec . string -flags</pre>
 +
  
 
==== Simpropcompiler ====
 
==== Simpropcompiler ====
Line 187: Line 220:
 
%Simpropcompiler% 2spb -symbols "%FSX_ROOT%propdefs\*.xml"
 
%Simpropcompiler% 2spb -symbols "%FSX_ROOT%propdefs\*.xml"
 
</pre>
 
</pre>
 +
  
 
== Useage ==
 
== Useage ==
Line 195: 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 ====
 
==== Windows 7 ====
Line 200: Line 235:
 
* SHIFT + Right-click on that folder
 
* SHIFT + 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'''
 +
  
 
=== Running ===
 
=== Running ===
Line 205: Line 241:
 
<br>
 
<br>
 
you must '''always''' wrap it in '''%''' characters.
 
you must '''always''' wrap it in '''%''' characters.
 +
  
 
==== Testing ====
 
==== Testing ====
Line 218: Line 255:
 
<br>
 
<br>
 
the tool will prompt you with example parameters.
 
the tool will prompt you with example parameters.
 +
  
 
==== Normal ====
 
==== Normal ====
Line 233: Line 271:
  
 
The output .spb will be in the current folder.
 
The output .spb will be in the current folder.
 +
  
 
== Related ==
 
== Related ==
 +
 
=== Internal ===
 
=== Internal ===
 
{{Template:Navbox-SDK (FSX)-Related}}
 
{{Template:Navbox-SDK (FSX)-Related}}
Line 244: 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