Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity target support packages won't install #81

Open
teknowledgist opened this issue Sep 12, 2024 · 3 comments
Open

Unity target support packages won't install #81

teknowledgist opened this issue Sep 12, 2024 · 3 comments
Assignees

Comments

@teknowledgist
Copy link

Describe the bug
After installing the unity package, installing unity-android or unity-win-il2cpp (Those are the two I need.) fail with a GUI window "Failed to locate Unity.exe!" and then Chocolatey reports a failure with exit code 2, "Setup was cancelled".

Expected behavior
Unity support packages will install if the dependency is installed.

Desktop (please complete the following information):

  • OS: Win11 23H2 (64-bit)
  • Version: 23H2

I did try rebooting in case the unity install had some variable or something necessary to be recognized. I also ran the installer with the /S switch manually and got the same result, so it's not directly the fault of the is package. I'm just hoping you are more knowledgeable about unity to be able to fix it. The NSIS installer does have a /D=<path> option which probably would work, but I'm not sure how to determine which Unity directory to point it at. I also don't know if the /D option would bypass the installer wanting the unity director defined.

Let me know if I can assist.

@jtcmedia
Copy link
Owner

The Chocolatey install package passes the /D option to the NSIS installer. Are you installing to a non-standard location? Not sure why it is failing in your case and I can't reproduce it. Like you say, it may be the Unity installer itself that is failing for some reason. A quick google search brought this up: https://discussions.unity.com/t/installer-for-the-platform-support-cant-find-unity-exe-when-i-try-to-setup/904148 although it is a bit outdated (I think the path has since changed).

@teknowledgist
Copy link
Author

I hate to correct you, but the /D parameter is only used for the "unity" package if the user uses the --params InstallationPath Chocolatey option. (Of course, the user could also use --ia "/D=<path>".) The other unity packages ("unity-android" and "unity-win-il2cpp" are the ones I'm playing with.) do not have the InstallationPath package parameter code in their chocolateyinstall.ps1 script.

Note that if you follow the "official" process for offline install, you get a BAT file like:

"UnitySetup64-6000.0.19f1.exe" -UI=reduced /D=C:\Program Files\Unity 6000.0.19f1
"UnitySetup-Android-Support-for-Editor-6000.0.19f1.exe" /S /D=C:\Program Files\Unity 6000.0.19f1
"UnitySetup-Windows-IL2CPP-Support-for-Editor-6000.0.19f1.exe" /S /D=C:\Program Files\Unity 6000.0.19f1

where the destination is explicitly laid out (and I did not specify a destination in the process). Because the ancillary support packages have a version-matched dependency on the unity package, you should be able to do the same thing. (I don't know how the f1 bit works, sorry.)

The difficult part for your unity-support packages would be identifying the path when the user has chosen a custom InstallationPath location for unity. You may be able to find the custom location in the C:\ProgramData\chocolatey\.chocolatey\unity<version> folder (especially If they have set the -n=useRememberedArgumentsForUpgrades feature.) That said, you could add the installationpath parameter option to the unity-support packages and add some verbiage to the description that puts the onus on the user to make sure they pass the same installationpath for the support package as they did for the primary unity package.

Hopefully, I am making sense here. 😄

@teknowledgist
Copy link
Author

I should add that I don't know why you can't reproduce it either. I'm testing it on a newly built Win11 system. It has other software on it of course, but it has no "history" with unity. (I did install unity-hub which I suppose could be affecting it. I'll try without it to see.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants