Search code examples
windowsunity-game-engineamazon-ec2boot

Start an UI Application (App.exe) on AWS Windows EC2 Machine without user login


Idea: The main idea behind this is: App to start on boot-up without login. As I am trying to implement Autoscaling on windows instance, if my server metric(CPU utilization) is beyond the limit. It should Autoscale. With every new instance on bootup, my App(unity.exe) should start. This App(Unity.exe is UI based App)

I have tried using below methods;

  1. Start-up: Created Shortcut of my App and kept in C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup. Yet, this is starting the application only on Userlogin. But failing to start app, without login upon bootup
  2. Windows Service Wrapper https://github.com/winsw/winsw: Yet this starting the App, but in CLI. I need app to start on UI

Solution

  • It is practically impossible to start the program in UI mode before login since GUI renders into a session which is created by logging in.

    My advice would be to just make the Windows auto login after booting and add your program to Startup folder or by using Scheduler which will make the program run automatically after logging in.

    By doing that you automate both logging in and starting the program in GUI mode.