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

Add admin popup on Windows when running install-unity #33

Open
wants to merge 36 commits into
base: windows
Choose a base branch
from

Conversation

ewilh
Copy link

@ewilh ewilh commented Sep 23, 2022

Added app.manifest for admin privilege request. Running install-unity will now prompt user for admin credentials.
The downside is that not all methods in install-unity require admin consent, but it will ask for it regardless.
I haven't changed anything from the default app.manifest except on line 19 with the code:
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
There might be more changes needed in the app.manifest before it's ready for production.

I also added RuntimeIdentifiers so that I'm able to publish the app. I'm not quite sure how you're able to publish on Windows without this.

I noticed that Unity was firstly installed on the path Unity {major}.{minor}, and I don't necessarily like that approach. Most Unity users (and especially those who use this tool) will install multiple different Unity versions on {major}.{minor}. I recommend removing this both for Windows and Mac, but here I've only removed it for Windows.

major_minor

@ewilh
Copy link
Author

ewilh commented Sep 23, 2022

Note that after the admin pop-up, a separate shell window with admin privileges will open. When the code is finished running, the admin shell window will close immediately, thus preventing the user from seeing the output. A solution is to add a "Press any key to exit" on Windows only. Something like this:

  public static int ExitAfterUserInput(int exitCode)
  {
      Console.WriteLine("Press any key to exit");
      Console.ReadLine();
      return exitCode;
  }

sttz and others added 29 commits October 27, 2022 12:07
- Updated across the board, including JDK and newly adding Android SDK Command Line Tools
- NDK is now installed from a DMG but needs some additional processing:
-- Added destination support to dmg packages, copies only app bundle content from dmg
-- Made reanmeFrom/To generic instead of only supported for zip
-- Support moving a directory in place of one of its parents (e.g. /path/to/source to /path/to)
…er improvements

- Reduces the amounts of requests and data loaded, can only load new releases instead of everything
- Releases should appear quicker, in cases where Unity is slow to update their archive
- Previously missing packages metadata (Documentation, Android components, language packs) is now provided by Unity
- Legacy scraper and ini system can still be used for unpublished Unity releases
- Platform / architecture is now split, added --arch option
- Added --clear-cache option to force clearing the cache at start
- Added --redownload option to force redownloading all files
- Optimize detecting current architecture, RuntimeInformation.OSArchitecture now works correctly on .Net 7
- Optimize finding Unity installations by using native Plist parser
- Improve handling of already downloaded files
- Check we're not running as X86 on a non-X86 system to avoid using the "Program Files (x86)" folder
- Default to installing directly in "Program Files" and not using the Unity Hub install location (like on macOS)
- Use "{ProrgamFiles}" variable in configuration to make settings more portable
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

Successfully merging this pull request may close these issues.

2 participants