Search Unity

Prevent built Unity .exe file to require admin privileges when running in Windows 10

Discussion in 'Windows' started by VisualTeamMA, Jan 8, 2019.

  1. VisualTeamMA

    VisualTeamMA

    Joined:
    Apr 8, 2018
    Posts:
    6
    We have built our unity game with unity 2018.3.0f1 and we are getting a problem when trying to run the built .exe file.

    We are using default player settings and development build is unchecked.

    Currently the file requires admin privileges to run it successfully, is there a way to prevent this from occurring and allow a standard windows user without admin privileges to run the .exe file?

    Also when we try run the .exe file without admin privileges it seems to be running in the background (checked in task manager) but nothing gets launched or even shown in the taskbar.

    We have also downloaded other unity games from online and they all have not required any admin privileges to run the game successfully.

    It would be great if someone could point us in the right direction for this and provide some advice on how to fix this problem.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    It shouldn't require admin privileges.

    Can you try updating to 2018.3.0f2? That's one of the three fixes that went into it before we launched final 2018.3.
     
  3. VisualTeamMA

    VisualTeamMA

    Joined:
    Apr 8, 2018
    Posts:
    6
    Thanks for the reply!

    We updated our Unity to version 2018.3.0f2 and built an empty test scene. However it still requires admin privileges to run successfully. I have posted below some screen shots of the default settings we used when building. We have also realised that this problem does not occur on previous versions of unity as we built a test scene with Unity version 5.6.6f2 and the built file does not require admin privileges to run successfully.

    Is there anything else we can do to fix this?


    Built Folder Structure:
    Build Files.PNG

    Build Settings:
    Build Settings.PNG

    Player Settings:
    Resolution And Presentation.PNG Other Settings.PNG
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    So what happens when you run without admin privileges? I just tried locally and an empty project works just fine on my machine without running as admin.
     
  5. VisualTeamMA

    VisualTeamMA

    Joined:
    Apr 8, 2018
    Posts:
    6
    When we run without admin privileges the application (build from Unity 2018.3.0f2) just sits in the background and we can see it in the task manager not doing anything but no application gets launched and we don't see anything in the task bar either.

    However it works normally when we build with Unity 5.6.6f2.
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Does that happen on an empty/default project too? Did you try attaching a debugger to see where it's stuck?
     
  7. VisualTeamMA

    VisualTeamMA

    Joined:
    Apr 8, 2018
    Posts:
    6
    Yes we have tried it with an empty project too and it still does not run successfully. It just sits in the background so nothing from the unity game really gets executed. Also the output_log.txt does not even get created but it does get created when we run it as Admin.
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Can you try creating a dump file and sending it to me when it's in non-working state? You can do it by right clicking the process in task manager "details" tab and choosing "Create dump file" option.
     
  9. VisualTeamMA

    VisualTeamMA

    Joined:
    Apr 8, 2018
    Posts:
    6
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    This is a bug in Unity, most definitely. Could you report a bug with that dump attached and tell me the 7 digit bug number you get in your email? That way we can track it properly.

    I'm not exactly sure why it triggers on your machine but not anywhere else we test. Does this happen to you on multiple machines?
     
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Also, there's a potential workaround: can you try deleting the UnityCrashHandler.exe that gets put next to the game executable?
     
    VisualTeamMA likes this.
  12. VisualTeamMA

    VisualTeamMA

    Joined:
    Apr 8, 2018
    Posts:
    6
    I have reported the bug and my case number is 1117610.

    Thank you very much for the workaround. Its great! - we deleted the UnityCrashHandler.exe and it does allow for the built game to run successfully without requiring admin privileges.

    I'm not sure why deleting the UnityCrashHandler.exe makes it work though.
     
  13. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    We discovered that this is caused by a domain group policy (usually set by IT for company issued devices). When that particular policy is set, CreateProcessW call will verify whether the launched executable is signed with a valid certificate.

    We're calling CreateProcessW at a point we shouldn't be, and that causes a deadlock. If you delete UnityCrashHandler.exe, we don't call CreateProcessW as we detect it's missing.
     
  14. GameIndustriesM

    GameIndustriesM

    Joined:
    Oct 26, 2019
    Posts:
    1
    Hello Sir, did this bug fixed in newer v of unity? I am expecting this bug on 2021.2.12f.
     
  15. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Yes, it was fixed in Unity 2019.2. Can you send me a dump that shows the issue you're having? It could be something else.