Unity exe won't run from cd/dvd

Hi guys,

Well, I finished a project and build the final executable out of it. it’s a multimedia project which should be run from a cd/dvd. so i created an Autorun.inf object beside autorun.exe (unity’s exe) and autorun folder (project folder). the project runs flawlessly from hard disk. but when i burn the project on a cd, it drops an error and close. the error message is something like “autorun.exe has stopped working” (win7 win xp)

i tried different approaches. i removed the autorun.inf, but the same result. i even build an exe from another poject, and again, no gain. i mean no matter what i built, unity’s exe wo’t run from cd/dvd rom.

I’m desperate. i appreciate any suggestion. :expressionless:
Regards

Probably the executable is trying to open file for saving on cd/dvd, maybe it quits due failure.

Download Process Monitor Process Monitor - Sysinternals | Microsoft Learn and check if your executable is trying to open/create file on cd/dvd.

Hope that helps

The assumption is correct.
Unity will not run from a write protected location because it can not generate the output_log.txt and then will go down due to it.

@ Tct: thanks for the link. i’ll test and let you know what’s happening at runtime.

@ dreamora: that’s not good. imho any log file should be written in os temp folder. so what can i do now? i want to automaticly play the unity’s exe by putting the disk into tray. and because of unity’s way of handling log file (based on assumptions), running directly from disk in not possible. is there any other way, rather than using an installer or something? any ideas?

thanks

You copy it to the desktop or whever you want and run it from there.
Thats the only way.
You can do this through a starter application invisibly as other software does too, you don’t needfully need an installer (though more convenient on windows - on osx its normal to drag apps to applications folder manually)

running from disk is not possible, nothing you can change.

I don’t know for Mac but… The doc says here.
-nolog (Windows only) : Do not produce output log. Normally output_log.txt is written in the *_Data folder next to the game executable, where Debug.Log output is printed.

Maybe you should try to see if it solves your problem Driffter.

Update:

-nolog argument definitely solve the problem. but here comes another question. how can i call the exe with -nolog argument in the disk? the “Open” command of autorun.inf which works under winXP, is now ignored by win7. so i’m wondering is there any other way to simply call unity’s exe with -nolog argument rather than building a cutomized installer?

Thanks again for your helps…

I wasn’t aware of this problem but it seems indeed that Microsoft just got rid of the autorun functionality on windows7 (which was often perceived as a nuisance) or at least deeply modified it. You’ll have to dig around to see what is possible or not I’m afraid.

Can you do it with a .lnk?

hmm wasn’t aware that another flag sneaked in … good to know and sorry about being wrong there.

lnk could potentially work (unsure due to the not known drive letter), if not then a bat file or a fake application that does nothing but start the application (-> starter) definitely would allow it.

Autorun should technically work on Win7 if you didn’t disable it, at least for non-rewritable disks, as the behavior was only killed for rewritable media to kill out worms like conficker which missused autorun very successfully thanks to users not reading thinking before clicking

Greetings guys,

well, i managed to solved the problem, thanks to you and the ideas you put into this topic.
unity’s executable doesn’t run without a readable “output_log.txt”, no matter where you place it or which argument you pass to it. so i created a batch file which silently copies entire disk to a local dirve and call the application from there. i know it’s awkward and sounds like a bad idea, but that’s what i did to manage the situation.

Hope that helps.

Might be worth an email to support to see if there’s another way. Or perhaps consider distributing on thumb drives?

New Update:

Guys, this problem is killing me. I decided to close the project with a bat file that copies entire disk (around 80Mb) to the HardDrive and then run the app from there. but the problem is that it’s taking way too long at the client’s pc to get copied (i don’t know if his dvd-rom is old or his antivirus is checking or whatever…) to the disk. and he thinks that software in buggy. while the truth is something else.

Unfortunately i need to run the project directly from cd (no installer…) and -nolog argument which is designed to prevent the app from producing logs is of no use.

I used to love unity3d, but now i feel disappointed that such a simple thing can’t be done in unity. if anyone know a workaround for this, i will be very grateful if you share it here…

Thanks

update: it seems that unity is not receiving any parameter from bat file or cmd. i mean unity will ignore -nolog or any other parameter that is written in the manual.

can you please test an application with an argument passed to it and see if this works as intended?

Are you on Unity Pro?
I just tested it here and didn’t have any problem with the log not showing up when starting from link.

Potentially the doc is at fail to specify what requires Pro (batchmode at least used to be a Pro only command line flag for example)

Thank you dreamora for aiding me with this. i’m using unity Pro v2.5. i tried to call the application with -nolog parameter in any possible way, with no luck. i also built an exe from a definitely empty project. with no code or object. and i still gives error on execution from read-only media.

can you please test your exe with this bat file?

@echo off
start "" yourapp.exe -nolog
exit

thanks

Well on 2.5 you can skip it. It will not work no matter what you do, its a feature that was added with Unity 3 if I remember correctly.
The manual you cite is for Unity 3.1

Unity 2.5 did only support the force opengl flag I think, perhaps the d3d9 ref but neither batchmode nor nolog

Damn…
So making an installer is the only option i have…

Anyway, thank you very much dreamora :wink: