Announcement

Collapse
No announcement yet.

help to restart an application

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • help to restart an application

    Hello everyone,

    I try to use some code find in the forum to restart my application.
    When i build the project in Hard Drive Folder mode it's ok.
    When i build the project in Web/Email Executable mode it's not ok, the application close only.
    I think it's about the built-in variable _SourceFolder, but I can't find a solution.

    Anyone have a solution?
    Thanks,

    Alain.

    Application_Restart.apz




  • #2
    simple

    PHP Code:
    System.Reboot(); 

    Comment


    • #3
      I guess I didn't understand
      But the second caseWeb/Email Executable mode ) will not work because once you close the program, nothing will be erased, then the program will not be found to boot again

      Comment


      • #4
        The only case is that the program is in a clear location and not in a temporary folder

        The _SourceFolder is only the location of the program anywhere on the computer
        Try the following code
        Dialog.Message (_SourceFolder, _SourceFilename)

        In the global function

        Comment


        • #5
          Thanks igliigli
          you are right, it' a temp location which is deleted when the program is closed.
          But i need an executable for my usb stick.
          I will try differently if i could.

          [PS: You are from Algéria no?]

          Comment


          • #6
            See globals.
            Attached Files
            Bas Groothedde
            Imagine Programming :: Blog

            AMS8 Plugins
            IMXLH Compiler

            Comment


            • #7
              thank you so much Imagine this is exactly what i needed.
              I will try to understand the code.

              Alain.

              Comment


              • #8
                Another Example using GlobalPaths plugin
                Application_Restart.zip

                Comment


                • #9
                  Originally posted by colc View Post
                  Another Example using GlobalPaths plugin
                  [ATTACH]n305358[/ATTACH]
                  To be honest; it's a demo when you don't include the source code, it's an example when you show people how you do it.
                  Bas Groothedde
                  Imagine Programming :: Blog

                  AMS8 Plugins
                  IMXLH Compiler

                  Comment


                  • #10
                    MyBad

                    P1 onshow - gpaths = GlobalPaths.GetPaths();--get paths

                    click parra "See code on global" to see code before page jump

                    Comment


                    • #11
                      Originally posted by Imagine Programming View Post

                      To be honest; it's a demo when you don't include the source code, it's an example when you show people how you do it.
                      always punctual and precise
                      ...... thanks for the code

                      however in the example of colc it was used an old script provided by shadowUK with GlobalPaths plugin

                      Code:
                      [B]function[/B] Application.Restart(nReturnCode, ...)
                      File.Run(_SourceFolder.. "//".._SourceFilename, Table.Concat(arg, " ", 1, TABLE_ALL), _SourceFolder, SW_SHOWNORMAL, false);
                      Application.Exit(nReturnCode);
                      [B]end[/B]

                      Comment

                      Working...
                      X