Beginning with Windows Vista, you won't be able to interact with the desktop when running your application as a service. This is basically the same for any Windows release since Vista:
As a workaround, you could simply launch 4D on the same machine and connect to the server as a client, then administer the database from there.
Another workaround may be to not launch it as a service at all, but to instead use the following approach:
- Setup a user to login automatically
- Use a batch file in combination with a 4DLink file to launch 4D and the appropriate database.
The batch file may look like this:
"C:\4D v11 SQL Release 4 Custom\4D Server\4D Server.exe" "C:\autostart.4Dlink"
The autostart.4DLink file may look like this:
<?xml version="1.0" encoding="UTF-8"?><database_shortcut structure_file="file:///D:/4D/myApp.4DC" data_file="file:///D:/4D/myApp.4DD"/>
- Optionally (for added security), you can also lock the workstation using the following command: "rundll32.exe user32.dll, LockWorkStation". This can be issued either through a batch file in the startup folder or in the registry.
The batch file for this may look like this:
rundll32.exe user32.dll, LockWorkStation
In this workaround, the database is not running as a service, but it is started automatically, and the screen is locked for added security.