Jump to content
The simFlight Network Forums

launching Makerwys.exe on vb.net


Recommended Posts

Hello Pete,

 

I'm trying to launch makerwy.exe on a vb.net application with the standard code shell or process.start and i've got the error :

 

"Failed to make Runways CSV files!..."

 

It creates the files on the project release folder of my application and not on the simulator folder while i run it at the good location yet

and on the runways.txt there is the mention :

 

" CFG file being used is: "G:\Lockheed Martin\Prepar3D v2\scenery.cfg"

 

instead of :

 

"CFG file being used is: "C:\ProgramData\Lockheed Martin\Prepar3D v2\SCENERY.CFG""

 

Can you help me write the good code ?

 

Regards,

Jul

Link to comment
Share on other sites

I'm trying to launch makerwy.exe on a vb.net application with the standard code shell or process.start and i've got the error :

 

"Failed to make Runways CSV files!..."

 

It creates the files on the project release folder of my application and not on the simulator folder while i run it at the good location yet

and on the runways.txt there is the mention :

 

" CFG file being used is: "G:\Lockheed Martin\Prepar3D v2\scenery.cfg"

 

instead of :

 

"CFG file being used is: "C:\ProgramData\Lockheed Martin\Prepar3D v2\SCENERY.CFG""

 

Can you help me write the good code ?

 

I don't know VB at all, let alone VB.Net, but there must be a way of telling Windows that you want the current folder, the one which MakeRunways is normally run from, is the main P3D install folder. It needs to be there because that's how the program works out how to get to the correct Scenery.cfg file.

 

The Windows API function I use to run programs is CreateProcess, which is defined as follows:

BOOL WINAPI CreateProcess(
_In_opt_     LPCTSTR lpApplicationName,
_Inout_opt_  LPTSTR lpCommandLine,
_In_opt_     LPSECURITY_ATTRIBUTES lpProcessAttributes,
_In_opt_     LPSECURITY_ATTRIBUTES lpThreadAttributes,
_In_         BOOL bInheritHandles,
_In_         DWORD dwCreationFlags,
_In_opt_     LPVOID lpEnvironment,
_In_opt_     LPCTSTR lpCurrentDirectory,
_In_         LPSTARTUPINFO lpStartupInfo,
_Out_        LPPROCESS_INFORMATION lpProcessInformation
);
The parameter "lpCurrentDirectory" provides the path in which the program is to think it is executing in. for MakeRunways this must be the main FS or P3D folder.
 
Regards
Pete
Link to comment
Share on other sites

Hi Jul,

 

This is a working example of calling makerunways using the Process() class in .NET.

 

Note that you need to specify the "WorkingDirectory" as the path to your prepar3d folder.

 

Your path with obviously be different to mine.

        Dim flightSimFolder As String = "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X"
        Dim makeRunways As Process = New Process()
        makeRunways.StartInfo.WorkingDirectory = flightSimFolder
        makeRunways.StartInfo.FileName = "MakeRwys.exe"
        makeRunways.Start()
        makeRunways.WaitForExit()
        MessageBox.Show("Done")

Paul

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.