Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by unisip · Nov 17, 2012 at 06:57 PM · standaloneservice

Can a Unity Stand-Alone EXE run as a service?

Is it possible to run a Unity stand alone as a windows service? My requirement is that the application is restarted if it crashes, and also as I need to run it on a Windows Server, it would be convenient to run it as a service so that it keeps running regardless of a session being opened.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image GerryM · Nov 17, 2012 at 07:05 PM 0
Share

I would advise to write a separate helper service, which checks if the main (Unity) program is still running. Your service could then restart the main program if needed.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Perillio · Jun 06 at 08:50 PM

For those still in need of the solution:

  • open up a command prompt as admin

  • type: SC CREATE "Name of the Service" binpath= "X:\Folder\filename.exe"

  • be happy with your new service

Cheers

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · Jun 07 at 09:27 AM 0
Share

Note: when you want to pass commandline arguments, have a look at this SO question. Specifically you have to quote the actual path seperately from the arguments. At least this is necessary if your path contains spaces

 SC CREATE nameOfService binpath= "\"X:\Folder\filename.exe\" -nographics -batchmode -nolog"


avatar image
0

Answer by unisip · Nov 18, 2012 at 10:39 AM

Agreed. In fact i ve done that already a d it works just fine. Making the unity app a service itself would improve the solution by enabling it to run without a windows session or in a locked session, which is better from a security standpoint

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image chetan-rane · Jul 25, 2014 at 07:27 AM 0
Share

hey unisip i am looking for same thing...i wanted to create unity standalone app as a service which run on windows server in background. my client app will send request to this service, and this service will serve client's request.

could you please guide me or provide some reference how you achieve it?

thanks in advance

avatar image Viitorcloud chetan-rane · Feb 19, 2019 at 12:54 PM 0
Share

@chetan-rene did you get the solution?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

.exe (Standalone) builds & executes on development PC, but no where else (consumes a .net SOAP web service) 1 Answer

Unity Analytics not validating 3 Answers

Which well-known household-name brands are using Unity? 2 Answers

speed change in standalone compared to editor? 1 Answer

Standalone OSX players can't start after having been through DropBox 0.7.110 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges