Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    RestartApplication() / c4d.RestartMe()

    Cinema 4D SDK
    c++ python classic api
    2
    4
    945
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • fwilleke80F
      fwilleke80
      last edited by fwilleke80

      Hi there,

      I wonder if anyone knows about the parameters for the C++ API function RestartApplication() and its Python counterpart c4d.RestartMe().

      C++:
      void RestartApplication(const Utf16Char* param = nullptr, Int32 exitcode = 0, const Utf16Char** path = nullptr)

      Python:
      c4d.RestartMe(param=None, exitcode=0)

      What can I do with param, and - even more interesting - what can I do with C++'s path? I suspect that pathlets me start another application instead of Cinema 4D.

      I'm asking because I'm thinking about implementing a plugin updater that would, just like the C4D updater, be able to exit Cinema, and start an application instead that will update the plugin files.

      Thanks in advance!

      Cheers,
      Frank

      www.frankwilleke.de
      Only asking personal code questions here.

      1 Reply Last reply Reply Quote 0
      • a_blockA
        a_block
        last edited by

        Hi Frank,

        RestartApplication() won't help you here.
        Via param you can pass command line arguments to the restarted Cinema 4D.
        The exitcode is used as exit code for the quitting Cinema 4D.
        And path is actually highly system dependent. While being ignored on macOS, on Windows it will return the path of the running Cinema 4D instance.

        Couldn't you just start your plugin installer as a detached process and then quit Cinema 4D?

        Cheers,
        Andreas

        fwilleke80F 1 Reply Last reply Reply Quote 2
        • fwilleke80F
          fwilleke80 @a_block
          last edited by fwilleke80

          @a_block said in RestartApplication() / c4d.RestartMe():

          RestartApplication() won't help you here.
          Via param you can pass command line arguments to the restarted Cinema 4D.
          The exitcode is used as exit code for the quitting Cinema 4D.
          And path is actually highly system dependent. While being ignored on macOS, on Windows it will return the path of the running Cinema 4D instance.

          Ah, ok, thanks! Maybe you could put that information into the SDK docs for the next update, for new generations of clueless developers? 😉

          @a_block said in RestartApplication() / c4d.RestartMe():

          Couldn't you just start your plugin installer as a detached process and then quit Cinema 4D?

          I guess that's what it will come down to, yes.

          Thank you!

          www.frankwilleke.de
          Only asking personal code questions here.

          1 Reply Last reply Reply Quote 0
          • a_blockA
            a_block
            last edited by a_block

            Sorry, in contrary to what I had written here before, we will not add RestartApplication() to the documentation. These calls have certain intricacies, so their use will be at own risk. This is now based on an answer from our development.
            Cheers,
            Andreas

            1 Reply Last reply Reply Quote 2
            • First post
              Last post