redhawk989 / eyetrackvr-installer Goto Github PK
View Code? Open in Web Editor NEW[BROKEN] Simple C# installer for EyeTrackVR
[BROKEN] Simple C# installer for EyeTrackVR
Hi I'm literally only going to critique the installer a lot because I've been working on an installer for Amethyst for the past few months and seeing what this installer is like is just AAAAA. Anyway here's the big list of things that you should fix:
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static void LoadOpenVRAPI() {
var ovrDll = Path.GetFullPath(Path.Combine(Constants.AmethystTempDirectory, "openvr_api.dll"));
Util.ExtractResource("Binaries.openvr_api.dll", ovrDll);
// Load the openvr_api.dll unmanaged library using P/Invoke :D
var result = Kernel.LoadLibrary(ovrDll);
if ( result == IntPtr.Zero ) {
Logger.Fatal("Failed to load openvr_api.dll!");
Logger.Warn("Falling back to openvrpaths.vrpath...");
s_failedToInit = true;
} else {
Logger.Info("Successfully loaded openvr_api.dll!");
}
s_initialized = true;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void ExtractResource(string resourcePath, string filePath) {
using ( var resource = Assembly.GetExecutingAssembly().GetManifestResourceStream($"amethyst_installer_gui.Resources.{resourcePath}") ) {
using ( var file = new FileStream(filePath, FileMode.Create, FileAccess.Write) ) {
resource.CopyTo(file);
}
}
}
[DllImport("kernel32", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern IntPtr LoadLibrary(string lpFileName);
Why is the installer using .NET 6.0, and not .NET Framework? It's 150 MB, that's too large for an installer. Every Windows install since Windows 7 has .NET Framework pre-installed, take advantage of that (that means you don't need to include the entire runtime with the installer binary)! An installer should be tiny in file size and have 0 dependencies (it's an installer, the whole point is to setup everything on your system properly for whatever you're installing).
What's the design language you're going for? The installer has "fancy"-ish UI (more-on that in a bit) but is inconsistent in terms of design with the actual application. People like me who have OCD exist and this sort of inconsistency makes my blood boil.
What with the whitespace in the code? Clean it up!
Why are you using WebClient then HttpClient? HttpClient can make a GET request perfectly fine (see HttpClient.GetStringAsync() )
You can abstract opening a link to a method, you've got it 3 times already.
You should make an uninstaller too. Here's the documentation for the uninstaller registry keys from MSDN for reference. ALSO EXTREMELY IMPORTANT: make sure you don't format user's drives. PLEASE IMPLEMENT THIS IF YOU WRITE AN UNINSTALLER.
Also use IlMerge to merge .NET libraries together into a single binary. That way you can distribute a single exe file to your users, instead of a massive ZIP archive.
Use Checkbox.IsChecked instead of this. It's a literal property in the Checkbox class.
Nitpick: Use Path.Combine("some/path", "directory");
and Path.GetFullPath("some\path/with\random/backslashes");
Sanitise the folderPath
variable. I could type in Among us
into the folder path and your installer will explode. TLDR: Make sure that the folder the user typed exists.
The padding on the "Downloading..." button bugs me...
Consider making a successful installation more obvious, either by showing the user a dialogue box (see MessageBox.Show()
) or something else that grabs the user's attention.
The installer cannot continue while downloading,because of China's network environment?(I am Chinese)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.