Jump to content
The simFlight Network Forums

Starting and closing programs with WideFS


Recommended Posts

Hello,

 

I have a an issue with starting/closing apps using WideFS. Maybe I understand something wrong...but, I am out of ideas :(

 

Here is to my configuration:

 

Server PC:

Running Windows 10 Home EN

********* FSUIPC4, Version 4.949k by Pete Dowson *********
Prepar3D.exe version = 3.2.3.16769
 
WideFS settings in FSUIPC.ini:
[WideServer]
Log=Errors+
WideFSenabled=Yes
AdvertiseService=1
Port=8002
Port2=9002
!1=;Allow FS to be closed by clients. This allows to turn off the whole computer
AllowShutdown=Yes
!2=;This will send shutdown notification to clients when FS closes, telling them to close all apps they opened
AutoShutdown=Apps
RestartHotKey=78,11
 
.....
 
[buttons]
....
651=P64,22,Cx02003320,xDCBA
652=P64,23,Cx02003320,xABCD
 
 
Client 1:
Running Windows 10 Home EN
 
This is from WideClient.ini
[user]
Log=Errors+
AllowShutdown=Yes
RunReady1=c:\ASNext_P3D\ASNext.exe
DelayReady1=5
CloseReady1=Yes
RunReady2=C:\Sim Physics X_P3D\Sim Physics P3D.exe
DelayReady2=5
CloseReady2=Yes
RunReady3=C:\Program Files\Air Manager\airmanager.exe
CloseReady3=Yes
 
Client 2:
Running Windows 10 Home EN
 
WideClient.ini for Client2:
; -----------------------------------------------
[user]
Log=Yes
AllowShutdown=AppsOnly
ButtonScreen=Yes
RunReady1=notepad.exe
CloseReady1=Yes
 
 
[GPSout]
Port=com4
Speed=19200
 
[buttonScreen]
Size=9,5
Title1="===System Menu==="
0=G0r"Misc"
1=T"Pause"
2=T"Slew"
3=B"Clear\rWeather"
4=B"Toggle\rTraffic"
5=B"Refresh\rScenery"
6=B"Reload\rAircraft"
7=B"Escape"
8=B"Restart\rFlight"
9=G9r"Logging"
10=T"Weather"
11=T"IPC Writes"
12=T"IPC Reads"
13=T"Extras"
14=T"Button and Keys\r(Extended)"
15=T"VRI Comms"
16=T"com HID"
17=T"L:Vars"
18=T"Axes"
19=T"Events"
20=T"Button and Keys\r(Standart)"
21=T"Lua (separate)"
22=T"Log to console"
23=B"New log file" 
24=U
25=U
26=U
27=G28r"Programs\rcontrol"
28=Ba"Close FS"
29=Ba"Shutdown FS"
30=U
31=U
32=U
33=U
34=U
35=U
36=U
37=U
38=U
39=U
40=U
41=U
42=U
43=U
44=U
 
All software is executed with Admin rights (Prepar3D, WideClient etc.)
 
Ok, according to documentation and my understanding of it, when I start Prepar3D (and when WideFS is ready), all the defined applications should be started on the 
client PCs. This works for the first time. When I exit Prepar3D (using menu - Exit Prepar3D), the applications on the client PCs should be turned off and WideClients should wait for another simulator session.
 
Ok, but the programs does not close. If I close them manually, WideClient is not aware of it and when I start Prepar3D again, no program is started.
 
When I close simulator using "Close FS" on Client 2 (from defined ButtonScreen), everything works as expected. Prepar3D is closed, as well as all apps started by WideClients and everything starts again with new simulator session.
 
Is this how it is supposed to work or not? Thought the shutdown message should have been sent when closing Prepar3D, but is seems it is not. Maybe this has something to do with the fact that the menus are done with the Scaleform now, If I am not mistaken.
 
Think this configuration worked with Prepar3D v 2, but maybe my memory fails me.
 
Anyway, if anybody can point out something, would be great. Thanks for any reply.
 
Happy flying

 

Link to comment
Share on other sites

WideFS settings in FSUIPC.ini:

[WideServer]
Log=Errors+
WideFSenabled=Yes
AdvertiseService=1
Port=8002
Port2=9002
!1=;Allow FS to be closed by clients. This allows to turn off the whole computer
AllowShutdown=Yes
!2=;This will send shutdown notification to clients when FS closes, telling them to close all apps they opened
AutoShutdown=Apps
RestartHotKey=78,11

 

You have two AllowShutdown parameters. Only one will be read, possibly the first, maybe the second. I don't know how Windows behaves when you have duplicate keys -- you should only have one.

 

 

Client 1:
Running Windows 10 Home EN
 
 
This is from WideClient.ini
[user]
Log=Errors+
AllowShutdown=Yes
RunReady1=c:\ASNext_P3D\ASNext.exe
DelayReady1=5
CloseReady1=Yes
RunReady2=C:\Sim Physics X_P3D\Sim Physics P3D.exe
DelayReady2=5
CloseReady2=Yes
RunReady3=C:\Program Files\Air Manager\airmanager.exe
CloseReady3=Yes
 
WideClient will try to run those three programs when the connection is up and running.
 
Client 2:
Running Windows 10 Home EN
 
WideClient.ini for Client2:
; -----------------------------------------------
[user]
Log=Yes
AllowShutdown=AppsOnly
ButtonScreen=Yes
RunReady1=notepad.exe
CloseReady1=Yes
 
Same there for that one program, assuming "notepad.exe" is in the same folder as WideClient, because you've not given a path. And there is no parameter "AppsOnly" for AllowShutdown, it is "AppOnly".
 
All software is executed with Admin rights (Prepar3D, WideClient etc.)
 
Why? There's almost never a need for that.
When I exit Prepar3D (using menu - Exit Prepar3D), the applications on the client PCs should be turned off and WideClients should wait for another simulator session.
 
You mean the "AllowShutdown=AppOnly" action? You need to specify that if you want that.
 
Pete
 
Link to comment
Share on other sites

You have two AllowShutdown parameters. Only one will be read, possibly the first, maybe the second. I don't know how Windows behaves when you have duplicate keys -- you should only have one.

 

 

I dare to disagree here :) One is AllowShutdown and the other is AutoShutdown. According to my understanding of the documentation (WideFS Technical.pdf), I set

 

AllowShutdown=Yes - to allow flight sim server to be shutdown by clients (or just sim closed).

 

and 

 

AutoShutdown=Apps - for WideServer (FSUIPC) to tell clients to close the "CloseReady" apps when Prepar3D is closed.

 

WideClient will try to run those three programs when the connection is up and running.

 

 

It does, but for my setup, only on the first session. When I close Prepar3D, the apps are not closed and thus not started again on new session.

 

Same there for that one program, assuming "notepad.exe" is in the same folder as WideClient, because you've not given a path. And there is no parameter "AppsOnly" for AllowShutdown, it is "AppOnly".

 

 

Well I used notepad just for testing purposes as it is "simple" program. And it is in the system path so does not need to specify path. But thanks for pointing out mistyped Apps Only parameter, I could be looking at it thousand more times without noticing it. One char mistyped - programmers worst enemy. You usually need somebody else to find out these :)

 

Why? There's almost never a need for that.

 

 

True. But Sim Physics, for example is the exception which requires it. Let's leave the fact that it is not much quality software aside, since I've already paid for it....

 

You mean the "AllowShutdown=AppOnly" action? You need to specify that if you want that.

 

 

Can you suggest what the configs should look like then? I wanted to:

 

On client 2, I have defined the "Close FS" and "Shutdown FS" buttons. Via these, I wanted to be able to close Prepar3D and apps on client PCs / or shutdown server pc and client 1 pc. Well, this works ok.

Also, when I exit simulator using normal menu option - "Exit Prepar3D", this should send request to close the apps on client PCs - this does not work.

 

Because I probably missing something here...

 

Thanks

Link to comment
Share on other sites

set the AutoShutdown=Yes in FSUIPC4.ini and the AllowShutdown=Yes or App or AppOnly on the clients to decide what happens there.

Important is the AutoShutdown=Yes on the server for that.

AllowShutdown=... will effect the FS and the started Apps by FSUIPC4.

 

 
Hi,
 
thanks for answer. Unfortunatelly, still not able to make it work. Tried to set AutoShutdown=Yes in FSUIPC.cfg (actually, I already had that). Then I tried to vary AllowShutdown parameter on client PC via all values - ie: Yes, App, AppOnly and the apps on client PC were never closed after I closed P3D and WideClient lost connection.
 
As I wrote before, if I initiate the action using "Close FS" button defined in WideClient on client PC, P3D is closed also as are the apps on clients, and WideClient.log contains a line saying that:
 
Shutdown request received! (param=DCBA)
 
This line is never there when I close P3D normally using Esc -> Exit Preapr3D. So I think the request is not being send as it should be.
 
Well, I am sure there are more important issues that need to be solved and this one is actually not a big pain in the... fuselage, just hate these moments when I cannot figure things out :) Not saying that will not be happy for another suggestions, if anyone have any.
Edited by Mouseviator
Link to comment
Share on other sites

  • 2 weeks later...

 

As I wrote before, if I initiate the action using "Close FS" button defined in WideClient on client PC, P3D is closed also as are the apps on clients, and WideClient.log contains a line saying that:
 
Shutdown request received! (param=DCBA)
 
This line is never there when I close P3D normally using Esc -> Exit Preapr3D. So I think the request is not being send as it should be.

 

The problem is one of timing. It sometimes works for me, but it is inconsistent. The time between SimConnect notifying FSUIPC of a shutdown and the shutdown actually occurring varies and is sometimes insufficient.

 

The only reliable way to do what you want is to tell FSUIPC to initiate the shutdown (as you have described from a Client). You can do it from the Server too, using the shutdown hotkey in WideServer. I use "Ctrl+Shift+E" so my parameter in the [WideServer] section of FSUIPC4.INI is:

 

ShutdownHotkey=69,11

 

Pete

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.