Win32 il2cpp Process.Start not work

Unity2018.1.6f1
Win32 IL2Cpp Process.Start(run_path, url); not work.
Mone is fine.
output_log print this :
System.ComponentModel.Win32Exception: Success
System.Diagnostics.Process.Start_shell

Can we get a bug report on this?

[quote=“Tautvydas-Zilys”, post:2, topic: 707176]
Can we get a bug report on this?
[/quote]
(Case 1058636) Win32 il2cpp Process.Start not work.
https://fogbugz.unity3d.com/default.asp?1058636_k20hpprrme8tthcm

Thanks, we will take a look.

Has this ever been fixed? I am on 2019.3 right now and get the same error. This is really bad for any automation out of a Unity app and currently a blocker for me. Are there any workarounds known?

We’ve not implemented process creation or management in managed code with IL2CPP. I don’t expect that we will implement it soon, so I would recommend either using Mono scripting backend or using your own native library to handle processes.

Thanks for the quick reply. I have switched to Mono for my Desktop builds and that works indeed nicely but it's a pity that this is yet another property my custom build chain will have to consider between platform builds. Would be really great to have this aligned :-)

1 Like

[quote=“JoshPeterson”, post:6, topic: 707176]
We’ve not implemented process creation or management in managed code with IL2CPP. I don’t expect that we will implement it soon, so I would recommend either using Mono scripting backend or using your own native library to handle processes.
[/quote]

@JoshPeterson so starting a process from within an IL2CPP build is not possible, and thats a feature?

[quote=“TJHeuvel-net”, post:8, topic: 707176]
@JoshPeterson so starting a process from within an IL2CPP build is not possible, and thats a feature?
[/quote]

Correct, IL2CPP does not currently support starting of processes.

1 Like

Ok; thanks for the quick response.

Luckily we could get around it, in case anyone wants to start a steam process you can also call OpenUrl with a rungameid url.

1 Like

Is it planned to be possible in the foreseeable future?

That was a huge surprise for me when I've got the Win32Exception: Success in unity 2019 LTS while trying to start a process from the IL2CPP build xD

Hope it will be implemented in the future.

What's so challenging about implementing this feature? can't we at least execute a shell command and get the stdout?

I have to run "/bin/bash -c 'df -BM --output=avail "." | tail -n 1'" so I can get the correct free disk space, as no other tools are available for linux. But not being able to start a process seems a bit shocking

[quote=“thefallengamesstudio”, post:13, topic: 707176]
What’s so challenging about implementing this feature? can’t we at least execute a shell command and get the stdout?
[/quote]

To be honest, starting a process is pretty easy, but the .NET Process API is pretty rich and complex, so implementing the entire thing is not trivial.

2 Likes

[quote=“JoshPeterson”, post:14, topic: 707176]
To be honest, starting a process is pretty easy, but the .NET Process API is pretty rich and complex, so implementing the entire thing is not trivial.
[/quote]
I see, so it’s an all or nothing thing. Makes sense, but I think we’d be happy with just a few features implemented, and some throwing NotImplementedException (instead of cryptic native errors).
There are 2 guys on asset store each selling a partial implementation of this as an asset. I think it’s in everyone’s interest to approach them and take over their work, for fair price.
The one I chose doesn’t seem to support the Process.StandardOutpout.ReadToEnd(). Might be something you could start with.

1 Like

[quote=“thefallengamesstudio”, post:15, topic: 707176]
I see, so it’s an all or nothing thing. Makes sense, but I think we’d be happy with just a few features implemented, and some throwing NotImplementedException (instead of cryptic native errors).
There are 2 guys on asset store each selling a partial implementation of this as an asset. I think it’s in everyone’s interest to approach them and take over their work, for fair price.
The one I chose doesn’t seem to support the Process.StandardOutpout.ReadToEnd(). Might be something you could start with.
[/quote]

Although I would like to do this, to be completely transparent, I don’t think it is something that we will implement soon. With other priorities in the mix, this one has not risen to the top in a while, and I don’t expect it to.

[quote=“JoshPeterson”, post:6, topic: 707176]
We’ve not implemented process creation or management in managed code with IL2CPP. I don’t expect that we will implement it soon, so I would recommend either using Mono scripting backend or using your own native library to handle processes.
[/quote]

This information should be added to “Scripting Restrictions” in the docs.

2 Likes

Good point! I’ll add it there.

[quote=“JoshPeterson”, post:18, topic: 707176]
Good point! I’ll add it there.
[/quote]
Thanks for adding it to the 2023 docs Josh. On behalf of dozens of devs who’ll run into this downstream from today, any chance it gets added to previous supported versions ?

It sucks to be looking for documentation for the version of Unity you use and have restrictions more up to date on the latest version but not the version we’re on, and to have to crawl through forums and google search to look for it. I understand if updating legacy version docs is frowned upon - but supported versions should be up for grabs.

1 Like

[quote=“RocketRidah”, post:19, topic: 707176]
Thanks for adding it to the 2023 docs Josh. On behalf of dozens of devs who’ll run into this downstream from today, any chance it gets added to previous supported versions ?

It sucks to be looking for documentation for the version of Unity you use and have restrictions more up to date on the latest version but not the version we’re on, and to have to crawl through forums and google search to look for it. I understand if updating legacy version docs is frowned upon - but supported versions should be up for grabs.
[/quote]

Thanks, this is a really great point. I’m not sure why I did not back port the documentation when I made this change. I’ll go ahead and do that now.

1 Like