[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.setup

VS 2003 - Auto launch app on installation complete

Marc Castrechini

6/12/2006 8:31:00 PM

This is definately a noob question but I can't find this anywhere:

I simply want to get the primary output executable to automatically launch
once installation is complete. Either prompting the user with an option to
do so (checkbox?) or automatically doing it with no prompt.

I am using VS 2003 and the 1.1 framework.

TIA,
- Marc Castrechini


5 Answers

mike.liddell

6/14/2006 5:20:00 AM

0

I confess I haven't tried this, but I'd like to know the answer too.

I would try a custom action that starts a new process.
You may need to set the working folder for your app to run correctly.
To do this, either pass [TARGETDIR] to your custom action, or transfer
it via the registry.

some code for starting a process that I have lying around is:

public static int RunProcess_Synchronous(string workingFolder, string
exePath, string argsString, out string stdout)
{
Process process = new Process();
process.StartInfo.UseShellExecute = false; //allows
redirect, but only exes/bats can be specified.
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.Arguments = argsString;
process.StartInfo.WorkingDirectory = workingFolder;
process.StartInfo.FileName = exePath;

Debug.WriteLine("RunProcess:: dir=" +
process.StartInfo.WorkingDirectory + " fileName=" +
process.StartInfo.FileName + " args=" + process.StartInfo.Arguments);
process.Start();
process.WaitForExit();

int exitCode = process.ExitCode;
stdout = process.StandardOutput.ReadToEnd();
return exitCode;
}


Marc Castrechini wrote:

> This is definately a noob question but I can't find this anywhere:
>
> I simply want to get the primary output executable to automatically launch
> once installation is complete. Either prompting the user with an option to
> do so (checkbox?) or automatically doing it with no prompt.
>
> I am using VS 2003 and the 1.1 framework.
>
> TIA,
> - Marc Castrechini

mike.liddell

6/14/2006 5:22:00 AM

0

er... and change the process starter to not wait for exit.

mike.lidd...@gmail.com wrote:

> I confess I haven't tried this, but I'd like to know the answer too.
>
> I would try a custom action that starts a new process.
> You may need to set the working folder for your app to run correctly.
> To do this, either pass [TARGETDIR] to your custom action, or transfer
> it via the registry.
>
> some code for starting a process that I have lying around is:
>
> public static int RunProcess_Synchronous(string workingFolder, string
> exePath, string argsString, out string stdout)
> {
> Process process = new Process();
> process.StartInfo.UseShellExecute = false; //allows
> redirect, but only exes/bats can be specified.
> process.StartInfo.RedirectStandardOutput = true;
> process.StartInfo.CreateNoWindow = true;
> process.StartInfo.Arguments = argsString;
> process.StartInfo.WorkingDirectory = workingFolder;
> process.StartInfo.FileName = exePath;
>
> Debug.WriteLine("RunProcess:: dir=" +
> process.StartInfo.WorkingDirectory + " fileName=" +
> process.StartInfo.FileName + " args=" + process.StartInfo.Arguments);
> process.Start();
> process.WaitForExit();
>
> int exitCode = process.ExitCode;
> stdout = process.StandardOutput.ReadToEnd();
> return exitCode;
> }
>
>
> Marc Castrechini wrote:
>
> > This is definately a noob question but I can't find this anywhere:
> >
> > I simply want to get the primary output executable to automatically launch
> > once installation is complete. Either prompting the user with an option to
> > do so (checkbox?) or automatically doing it with no prompt.
> >
> > I am using VS 2003 and the 1.1 framework.
> >
> > TIA,
> > - Marc Castrechini

Marc Castrechini

6/14/2006 6:01:00 AM

0

I ended up creating an additional windows application project with one module
containing the following:

Module modRunApp
Public Sub main()
Dim Asm As System.Reflection.Assembly =
System.Reflection.Assembly.GetExecutingAssembly()
Dim FileInfo As System.IO.FileInfo = New System.IO.FileInfo(
System.IO.Path.GetDirectoryName(Asm.Location) & "\MyApp.exe")

Process.Start(FileInfo.FullName)
End Sub
End Module

I added that output to a Commit Custom Action and it works.

Thanks for your help,
- Marc

"mike.liddell@gmail.com" wrote:

> er... and change the process starter to not wait for exit.
>
> mike.lidd...@gmail.com wrote:
>
> > I confess I haven't tried this, but I'd like to know the answer too.
> >
> > I would try a custom action that starts a new process.
> > You may need to set the working folder for your app to run correctly.
> > To do this, either pass [TARGETDIR] to your custom action, or transfer
> > it via the registry.
> >
> > some code for starting a process that I have lying around is:
> >
> > public static int RunProcess_Synchronous(string workingFolder, string
> > exePath, string argsString, out string stdout)
> > {
> > Process process = new Process();
> > process.StartInfo.UseShellExecute = false; //allows
> > redirect, but only exes/bats can be specified.
> > process.StartInfo.RedirectStandardOutput = true;
> > process.StartInfo.CreateNoWindow = true;
> > process.StartInfo.Arguments = argsString;
> > process.StartInfo.WorkingDirectory = workingFolder;
> > process.StartInfo.FileName = exePath;
> >
> > Debug.WriteLine("RunProcess:: dir=" +
> > process.StartInfo.WorkingDirectory + " fileName=" +
> > process.StartInfo.FileName + " args=" + process.StartInfo.Arguments);
> > process.Start();
> > process.WaitForExit();
> >
> > int exitCode = process.ExitCode;
> > stdout = process.StandardOutput.ReadToEnd();
> > return exitCode;
> > }
> >
> >
> > Marc Castrechini wrote:
> >
> > > This is definately a noob question but I can't find this anywhere:
> > >
> > > I simply want to get the primary output executable to automatically launch
> > > once installation is complete. Either prompting the user with an option to
> > > do so (checkbox?) or automatically doing it with no prompt.
> > >
> > > I am using VS 2003 and the 1.1 framework.
> > >
> > > TIA,
> > > - Marc Castrechini
>
>

Mayur

6/14/2006 1:02:00 PM

0

Hi Marc,

I am also trying to launch an application on the completion of installation.
I have registered my exe that launches the application as a commit custom
action. But the custom action gets triggered as soon as the application is
installed, even before the user has pressed the 'Close' button on the
'Finished' dialog.

I just need to know if you are experiencing the same behaviour, or the
behaviour that I have been expecting.

Thanks in advance,
Mayur

"Marc Castrechini" wrote:

> I ended up creating an additional windows application project with one module
> containing the following:
>
> Module modRunApp
> Public Sub main()
> Dim Asm As System.Reflection.Assembly =
> System.Reflection.Assembly.GetExecutingAssembly()
> Dim FileInfo As System.IO.FileInfo = New System.IO.FileInfo(
> System.IO.Path.GetDirectoryName(Asm.Location) & "\MyApp.exe")
>
> Process.Start(FileInfo.FullName)
> End Sub
> End Module
>
> I added that output to a Commit Custom Action and it works.
>
> Thanks for your help,
> - Marc
>
> "mike.liddell@gmail.com" wrote:
>
> > er... and change the process starter to not wait for exit.
> >
> > mike.lidd...@gmail.com wrote:
> >
> > > I confess I haven't tried this, but I'd like to know the answer too.
> > >
> > > I would try a custom action that starts a new process.
> > > You may need to set the working folder for your app to run correctly.
> > > To do this, either pass [TARGETDIR] to your custom action, or transfer
> > > it via the registry.
> > >
> > > some code for starting a process that I have lying around is:
> > >
> > > public static int RunProcess_Synchronous(string workingFolder, string
> > > exePath, string argsString, out string stdout)
> > > {
> > > Process process = new Process();
> > > process.StartInfo.UseShellExecute = false; //allows
> > > redirect, but only exes/bats can be specified.
> > > process.StartInfo.RedirectStandardOutput = true;
> > > process.StartInfo.CreateNoWindow = true;
> > > process.StartInfo.Arguments = argsString;
> > > process.StartInfo.WorkingDirectory = workingFolder;
> > > process.StartInfo.FileName = exePath;
> > >
> > > Debug.WriteLine("RunProcess:: dir=" +
> > > process.StartInfo.WorkingDirectory + " fileName=" +
> > > process.StartInfo.FileName + " args=" + process.StartInfo.Arguments);
> > > process.Start();
> > > process.WaitForExit();
> > >
> > > int exitCode = process.ExitCode;
> > > stdout = process.StandardOutput.ReadToEnd();
> > > return exitCode;
> > > }
> > >
> > >
> > > Marc Castrechini wrote:
> > >
> > > > This is definately a noob question but I can't find this anywhere:
> > > >
> > > > I simply want to get the primary output executable to automatically launch
> > > > once installation is complete. Either prompting the user with an option to
> > > > do so (checkbox?) or automatically doing it with no prompt.
> > > >
> > > > I am using VS 2003 and the 1.1 framework.
> > > >
> > > > TIA,
> > > > - Marc Castrechini
> >
> >

Marc Castrechini

6/14/2006 4:03:00 PM

0

Yes, the commit action fires immidiately when the application is done
installing (not after the last close button click). I actually like this
because my app is loaded and usually running when they hit close.

- Marc

"Mayur" <Mayur@discussions.microsoft.com> wrote in message
news:807AFFA3-06E3-4167-A498-61D84C4B70F8@microsoft.com...
> Hi Marc,
>
> I am also trying to launch an application on the completion of
> installation.
> I have registered my exe that launches the application as a commit custom
> action. But the custom action gets triggered as soon as the application is
> installed, even before the user has pressed the 'Close' button on the
> 'Finished' dialog.
>
> I just need to know if you are experiencing the same behaviour, or the
> behaviour that I have been expecting.
>
> Thanks in advance,
> Mayur
>
> "Marc Castrechini" wrote:
>
>> I ended up creating an additional windows application project with one
>> module
>> containing the following:
>>
>> Module modRunApp
>> Public Sub main()
>> Dim Asm As System.Reflection.Assembly =
>> System.Reflection.Assembly.GetExecutingAssembly()
>> Dim FileInfo As System.IO.FileInfo = New System.IO.FileInfo(
>> System.IO.Path.GetDirectoryName(Asm.Location) & "\MyApp.exe")
>>
>> Process.Start(FileInfo.FullName)
>> End Sub
>> End Module
>>
>> I added that output to a Commit Custom Action and it works.
>>
>> Thanks for your help,
>> - Marc
>>
>> "mike.liddell@gmail.com" wrote:
>>
>> > er... and change the process starter to not wait for exit.
>> >
>> > mike.lidd...@gmail.com wrote:
>> >
>> > > I confess I haven't tried this, but I'd like to know the answer too.
>> > >
>> > > I would try a custom action that starts a new process.
>> > > You may need to set the working folder for your app to run correctly.
>> > > To do this, either pass [TARGETDIR] to your custom action, or
>> > > transfer
>> > > it via the registry.
>> > >
>> > > some code for starting a process that I have lying around is:
>> > >
>> > > public static int RunProcess_Synchronous(string workingFolder, string
>> > > exePath, string argsString, out string stdout)
>> > > {
>> > > Process process = new Process();
>> > > process.StartInfo.UseShellExecute = false; //allows
>> > > redirect, but only exes/bats can be specified.
>> > > process.StartInfo.RedirectStandardOutput = true;
>> > > process.StartInfo.CreateNoWindow = true;
>> > > process.StartInfo.Arguments = argsString;
>> > > process.StartInfo.WorkingDirectory = workingFolder;
>> > > process.StartInfo.FileName = exePath;
>> > >
>> > > Debug.WriteLine("RunProcess:: dir=" +
>> > > process.StartInfo.WorkingDirectory + " fileName=" +
>> > > process.StartInfo.FileName + " args=" + process.StartInfo.Arguments);
>> > > process.Start();
>> > > process.WaitForExit();
>> > >
>> > > int exitCode = process.ExitCode;
>> > > stdout = process.StandardOutput.ReadToEnd();
>> > > return exitCode;
>> > > }
>> > >
>> > >
>> > > Marc Castrechini wrote:
>> > >
>> > > > This is definately a noob question but I can't find this anywhere:
>> > > >
>> > > > I simply want to get the primary output executable to automatically
>> > > > launch
>> > > > once installation is complete. Either prompting the user with an
>> > > > option to
>> > > > do so (checkbox?) or automatically doing it with no prompt.
>> > > >
>> > > > I am using VS 2003 and the 1.1 framework.
>> > > >
>> > > > TIA,
>> > > > - Marc Castrechini
>> >
>> >