Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deploying an application that will call another

Status
Not open for further replies.

steve1rm

Programmer
Aug 26, 2006
255
GB
Hello,

I have 2 applications. In application 1 have a developed a simple setup wizard where the user has to enter some details. After they click next to continue and enter some more details. After they have done that, they will click finish. And Application 1 will call the setup of application 2 to install application 2

Application 2 will execute this line to install application 2
returnType = Shell("C:\Application2\setup.exe", AppWinStyle.NormalFocus, True)

The problem I have is that I will have 2 deployments, with the same name (setup). I wonder if it would be possible to merge these together, to make 1 setup.

I hope you can understand,

Many thanks in advance,

Steve
 
I am not sure if that way is the best. As i get it, you want by app1 to gather some info... and app2 is the real application. I believe that you should :

1. get the info you want by the setup project

or

2. have only app2, and add a form to it. The info will be saved somewhere, so if the info do not exist (launch 1st time) the load the form to get the info.

or

3. keep the 2 exes. One is the main app and the other is the collect user info app. The user should launch the main app. If the user data do not exist, then use your shell (or better have a look at the system.diagnostics.process) to launch the other exe and unload the main form. As soon as the user fills all the fields, the do an other shell to launch this time the main app.

* To have 2 exes simply add to your solution 2 windows application projects.

PS: I would prefer the 2nd way.

Hope these help!
 
I actually wrote something like this this very week. My approach was similiar to (2) above, although what I did was create a Module with a Sub Main and then I had three classes, SetupScreen, SetupStatusScreen, and SetupInfo. SetupScreen and SetupStatusScreen both derive from System.Windows.Form and I bet you could substitute the two applications you have in their place. SetupInfo is basically a class that contains all of the setup parameters and can talk between the two other forms. This is a short version of what I did:

Code:
Module Setup

    Public Sub Main(ByVal Args() As String)
        Dim si As New SetupInfo()
        If Args.GetLength(0) > 0 Then
            si.LoadFromFile(Args(0))
        End If
        If Not si.HasEnoughInfoToRun() Then
            Dim ss As New SetupScreen()
            ss.LoadInfo(si)
            ' Note  - I have public properties in si that ss
            ' will update based on entry in screen - there 
            ' are many other ways of doing that
            ss.ShowDialog()
            If ss.DialogResult <> DialogResult.OK Then
                Exit Sub
            End If            
        End If
        Dim sss As New SetupStatusScreen
        sss.Loadinfo(si)
        Application.Run (sss)
    End Sub
End Module

I hope this makes sense and helps. I abbreviated this some just so I would not have to explain a lot of details that don't apply to your particular situation, so I hope there is not an obvious error in my abbreviation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top