Announcement

Collapse
No announcement yet.

How to call a program after the [Finish] is pressed?

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

  • How to call a program after the [Finish] is pressed?

    Hello all, looking for a quick tip.

    I am using this code to get the %AppFolder% and then call an executable (welcome.exe) in one of the target subfolders.

    Actions | On Post Install
    if (Registry.DoesKeyExist(HKEY_CLASSES_ROOT, "Applications\\fsx.exe")) then
    -- fetch the current installation location at the proper place
    program = Registry.GetValue(HKEY_CLASSES_ROOT, "Applications\\fsx.exe\\shell\\open\\command", "", true)
    -- other operations
    path = String.Mid(program, 2, String.ReverseFind(program, "\\", false) - 1);
    -- set the destination folder
    SessionVar.Set("%AppFolder%", path);
    end
    result = Shell.Execute("%AppFolder%\\ORBX\\Scripts\\welcome .exe", "open", "", "%AppFolder%\\Scripts", SW_SHOWNORMAL, false);

    This all works 100% ok, but I'd like the Setup Factory installer app to close first, then the called welcome.exe to be run immediately after.

    Any clues as to how I can do this?

  • #2
    Launch you exe in the "On Shutdown" code section;
    however, I'd do it on the "On Next" of the final screen.

    Comment


    • #3
      Originally posted by jassing View Post
      Launch you exe in the "On Shutdown" code section;
      however, I'd do it on the "On Next" of the final screen.
      Thank you, I'll give it a try. Do I place my code before or after the Screen.Next(); command?

      Comment


      • #4
        Put it Before.

        Comment


        • #5
          Thanks for the help, much appreciated.
          Last edited by johnv; 06-01-2009, 01:48 AM.

          Comment


          • #6
            Originally posted by johnv View Post
            Thanks for the help, much appreciated.
            I guess you figured out how to use Shell.Execute() and the arguments parameter?

            Comment


            • #7
              Run program and initial file to open

              I have successfully open executables on install completion, and also opened individual files where the PC knows the mimetype, but with one file that I need to open, it looks like I need to run the program and call the file in the same command because it's a shared mimetype.

              For singular requests I have been using...

              File.Open(SessionVar.Expand("%AppFolder%\\program. exe"), "", SW_SHOWNORMAL);

              Is it possible to add a file for the program to open when loaded?
              ArtistScope - Copy Protection & DRM Software

              Comment


              • #8
                use file.run() and pass your exe a parameter.

                Comment


                • #9
                  Originally posted by jassing View Post
                  use file.run() and pass your exe a parameter.
                  How do you recommend passing the extra parameter?

                  result = File.Run(SessionVar.Expand("%AppFolder%\\program.e xe"), "", "", SW_SHOWNORMAL, false);

                  The file to run will be in the same folder... Can you please give an example?
                  ArtistScope - Copy Protection & DRM Software

                  Comment


                  • #10
                    hit F1 and look at help for File.Run()
                    There are examples. Look at example #1.
                    indigorose spent a lot of time (it shows in the quality) preparing the help file... it has a lot of great examples.

                    Comment


                    • #11
                      This is opening the exe but not the movie file...

                      result = File.Run(SessionVar.Expand("%AppFolder%\\CSPlayer. exe"), SessionVar.Expand("%AppFolder%\\Copyright.wmv"), "", SW_SHOWNORMAL, true);
                      ArtistScope - Copy Protection & DRM Software

                      Comment


                      • #12
                        I have zero experience with csplayer; does it work from the command line? some older players skipped doing any command line functionality...

                        Comment


                        • #13
                          It's basically the same as Windows Media Player.

                          I think that my error may be due to the file reference/location. It's in the same folder so could it be like .\\Copyright.wmv?
                          ArtistScope - Copy Protection & DRM Software

                          Comment


                          • #14
                            depending on how smart this player is (a quick google only yeilded a broken link from 2006, no, I don't need a link, I have windows media player)

                            You can try a relative path, but you'll most likely need to set the working folder.
                            You can also try putting quotes around your path-to-movie parameter.

                            Comment


                            • #15
                              This player hasn't been released yet... that's what the installer is for :-)

                              Niether of these worked...

                              -- result = File.Run(SessionVar.Expand("%AppFolder%\\CSPlayer. exe"), SessionVar.Expand("%AppFolder%\\Copyright.wmv"), "", SW_SHOWNORMAL, true);
                              result = File.Run(SessionVar.Expand("%AppFolder%\\CSPlayer. exe"), "Copyright.wmv", "", SW_SHOWNORMAL, true);
                              -- result = File.Run(SessionVar.Expand("%AppFolder%\\CSPlayer. exe"), ".\\Copyright.wmv", "", SW_SHOWNORMAL, true);
                              ArtistScope - Copy Protection & DRM Software

                              Comment

                              Working...
                              X