I need to get the username of the user running the installer for my custom install action. Because the installer gets special priviledges, Environment.UserName just gives "SYSTEM".
Environment.SpecialFolders.ApplicationData returns the current users appdata folder, but I can't reliably dig the username out of it.
More case specifics:
Using a Visual Studio 2008 Setup Project The custom action is an installer class run after install and is the only one in the project.
You can get some information from Environment variables. I am using
Environment.GetEnvironmentVariable("USERNAME");
to get current user name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With