Hi!

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

  • 0 Posts
  • 303 Comments
Joined 2 年前
cake
Cake day: 2024年6月1日

help-circle


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