none
Run an application after Install.

    Question

  • Hi,

    I've  created a setup project and add an Installer class to do my custom Action.
    When the installation is end i want to run my application :

    To do that I use the method Process.Start

    public override void Commit(IDictionary savedState) {
                base.Commit (savedState);
                string DirMain= System.Windows.Forms.Application.UserAppDataPath;
                DirMain = DirMain+"Hip\\Hip.exe";           
                System.Diagnostics.Process.Start(DirMain);
    }

    When I'm in a administrative windows account that run correctly but when i'm with a user with no privileges i've an error message of the JIT :

    JIT Debugging failed with the following error: Access is denied.”

    I search in the msdn and the solution is to add the user to the Debugger Users group.


    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/vxtskErrorJITDebuggingFailedWithFollowingErrorAccessIsDenied.asp


    I would like to know if there is an other way to do run my application when the install is finished?

    Maybe in the property msi there is an option to activate to run the application after install ?

    Thanks for your Help.

    Anton




    Friday, September 15, 2006 1:27 PM

All replies

  • Windows Installer can directly launch an exe, there's no need for an installer class for this purpose. However I think this MSI functionality is not exposed by Visual Studio. But htere's a tool you can use to post-process your built .msi setup. You can download it from http://www.cornerhouse.ca/en/msilaunch.html
    • Proposed as answer by dipesh123 Monday, March 05, 2012 8:14 AM
    Friday, September 15, 2006 1:47 PM
  • Hello Stefan,

    I've tested this morning msilaunch and it works perfectly.

    Thank you very much for your response .

    Have a good day.

    Anton.

     

     

     

    Monday, September 18, 2006 10:28 AM
  • this is exactly what i was searching for, but I cant get it to work. After I click CLOSE on teh install dialog nothing happens! Does this only work with executables and not files?  It wont seem to open a htm file.
    Wednesday, October 04, 2006 8:51 PM
  • There are different parsers of command lines in windows, and depending on which one you use you get different behavior when trying to launch URL's.  You can try to be more explicit by trying to run:

      iexplore.exe http://myserver/myapp.html

     

    Thursday, October 05, 2006 6:07 AM
    Moderator
  • Hello,

     

    My problem was only for the exe, for the other file i didn't test if i want to launch a site web after the installation i use my Installer Class.

    So i've tested some VBScript Custom Action :

    Sub Message

    MsgBox"Thank you for clicking on the button.",0,"VBScript Demonstration"

    Set IE = Wscript.CreateObject("InternetExplorer.Application")
    IE.Navigate("http://www.microsoft.com/downloads/details.aspx?displaylang=fr&FamilyID=262d25e3-f589-4842-8157-034d1e7cf3a3")
    IE.Visible = true

    End Sub

    I'm not a specialist on Vb but it work fine except for exe nothing appens

    Anton

     

    Thursday, October 05, 2006 9:18 AM
  • I think your problem with this code is that you're running on top of the installation process, msiexec.exe, so you're trying to run a program from the Windows System folder. You're not running in your application folder. As Stefan suggests, an executable you're installing can be launched as a install custom action.
    Friday, October 06, 2006 6:18 PM
    Moderator
  • The issue with that vbscript is that you can't say wscript.createobject because you're not running in the WSH, you're running in MSI. Just say CreateObject.
    Friday, October 06, 2006 8:16 PM
    Moderator
  • continuing this thread...

    what if you have to use the setup.exe and not the MSI? The MSI tools MSILaunch will not work for me. I want to launch a HTML file on completion of install, not an executable. Do I have to write a new project/EXE that opens the HTML and then include that file into my deployment project? Seems like a silly way to do it.
    Monday, November 13, 2006 9:06 PM
  • what if you have to use the setup.exe and not the MSI? The MSI tools MSILaunch will not work for me.

    That's true. As I said many times before: Visual Studio's capabilities to create Windows installer setups are very limited. There are many other tools that have more functionality and often also generate better setups. For a list of tools see www.installsite.org/go/msidev.htm

    I want to launch a HTML file on completion of install, not an executable. Do I have to write a new project/EXE that opens the HTML and then include that file into my deployment project?

    A Custom Action can only launch an executable. If you want to display a document (e.g. HTML or DOC file) with the associated application (web browser or WordPad/Word) then the ShellExecute API would be the right thing. There's a freeware tool called ShelExec.exe (note: just one L) available from www.naughter.com/shelexec.html . Launch this in your custom action, specifying the path to the HTML file on the command line.

    Friday, November 17, 2006 7:27 AM
  • This was the answer that i was looking for.. thanks stefan..

    Dipesh

    Monday, March 05, 2012 8:29 AM