Coder Social home page Coder Social logo

redhawk989 / eyetrackvr-installer Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 71.06 MB

[BROKEN] Simple C# installer for EyeTrackVR

C# 0.50% Python 0.77% XSLT 2.30% Jupyter Notebook 7.41% Jinja 1.17% HTML 5.04% Less 0.04% CSS 12.72% JavaScript 53.58% Smarty 0.04% Tcl 16.45%

eyetrackvr-installer's People

Contributors

redhawk989 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

eyetrackvr-installer's Issues

Installer Feedback

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:

  1. Embed native DLLs as an Embedded Resource. Create a temporary directory, and extract the resource to said directory. Here's how we handle extracting the native binary "openvr_api.dll" which we use to locate the SteamVR binaries, is handled in Amethyst Installer:
[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);
  1. 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).

  2. 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.

  3. What with the whitespace in the code? Clean it up!

  4. Just wait for the file to download; This is bad practice.

  5. Wrap the WebClient in a using statement so that it disposes when it goes out of scope. Then only use one WebClient for both of them.

  6. Why are you using WebClient then HttpClient? HttpClient can make a GET request perfectly fine (see HttpClient.GetStringAsync() )

  7. You can abstract opening a link to a method, you've got it 3 times already.

  8. 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.

  9. 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.

  10. Use Checkbox.IsChecked instead of this. It's a literal property in the Checkbox class.

  11. Nitpick: Use Path.Combine("some/path", "directory"); and Path.GetFullPath("some\path/with\random/backslashes");

  12. 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.

  13. The padding on the "Downloading..." button bugs me...

  14. 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.