Hi!

My previous/alt account is yetAnotherUser@feddit.de which will be abandoned soon.

  • 0 posts
  • 36 comments
Joined 2 years ago
Cake day: June 1st, 2024
  • I don’t know enough about Windows app development to answer this. Maybe it replaces the old .exe and the now replaced .exe is just continuing to run from RAM? Maybe there is some restarter.exe program in the same folder that does all the work. In any case, this depends far too much on the Windows update process and how to launch applications.

    I just know when I used Windows applications in the past, they were able to restart themselves after updating somehow.

  • I meant the old .exe would check the signatures before initializing the official Windows way to update. Effectively have this run whenever you start the application:

    main() {
        if (update_available()) {
            exe_path = download_update()
            if (signature(exe_path) == SIGNATURE) {
                install_update(exe_path)
                restart()
            } else {
                put_up_a_warning_or_something()
                delete(exe_path)
            }
        }
    # Rest of the application
    # ...
    }
    

    The only thing I have no idea how to implement would be the install_update(path) function. But surely this is one way to install updates without signatures recognized by Microsoft, right?

    And if for some reason you aren’t allowed to sign the .exe because this breaks something, then place an unsigned .exe in a signed zip folder.

  • Even though this isn’t C, but if we take from the C11 draft §6.8.5 point 6 (https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf):

    An iteration statement whose controlling expression is not a constant expression, that performs no input/output operations, does not access volatile objects, and performs no synchronization or atomic operations in its body, controlling expression, or (in the case of a for statement) its expression-3, may be assumed by the implementation to terminate

    “new Random().nextInt()” might perform I/O though so it could still be defined behavior. Or the compiler does not assume this assumption.

    But an aggressive compiler could realize the loop would not terminate if x does not become 10 so x must be 10 because the loop can be assumed to terminate.

  • I really like bash when dealing with even somewhat advanced scripting. Like the 300 LOC scraper I have written over the past two days which horribly parses HTML files using grep | sed.

    It’s genuinely so much more fun to do this with Bash than, say, Python. I have once written a scraper using Beautifulsoup and I have no desire to do so ever again.

    Honestly, only Haskell manages to beat Bash in how satisfying it feels when you manage to get something working well.

  • I think it can apply to the most general workflow with branches as well, where branches are used to develop features and then later merge them.

    After all, any new branch is basically a “remaster” until merged back in, which is when the original master becomes the remaster.

    Sure, the analogy isn’t perfect because in music the original master isn’t supposed to change – but the entire purpose of a version control system is to change the “master record”, i.e. what’s deployed to production.