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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pathname Package & Deployment Wizard 1

Status
Not open for further replies.

BasicBoy

Programmer
Feb 22, 2008
156
0
0
ZA
I have written an Install.exe program which in its turn runs the setup.exe file of the Package and Deployment Wizard with the Shell function.

In the P&DW, the installer is asked to choose a path/directory for the installation of the package, which parameter is unknown to the Install.exe program.

The Install program then takes over again to make a desktop shortcut, but it does not know what the destination path/folder of the installed product is.

I need to get the path from the P&DW which is stored in the frmSetup1.tag property of one of the forms in the P&DW.

How do I read that path/folder from that form run in the Shell command and make it known to the Install.exe program - preferably in a label control.

Thanks.
 
Okay, when you use the PDW to create a setup program for you, you will end up with three files. Setup.exe, setup.lst, and setup.cab. Now, what the setup.exe does is extract the contents of the cab file, which includes the setup1.exe which does the actual work. Then the setup.exe shells the setup1.exe program with a command line parameter. Now it is this exe that you are interested in as if you look where vb is installed (C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard), you will find the setup1 folder. Inside of this folder you will find the setup1.exe project and this is what you will need to modify but I must warn you, make two copies of this project before you start to modify it. One will be for backup and the other copy will be for you to customize. Inside of this project you will find all the sparse comments by M$ to be able to customize this project to accomplish what you will want to do. Now, how you accomplish what you want to do will be up to you but if you say that you have a replacement for the setup.exe, then you could possibily add onto the parameter that is passed, the hwnd of a textbox on your form. Then the setup1.exe could use sendmessage to send you the information back to your custom setup.exe...

Please remember to create a backup of this project...



Good Luck
 
Thanks vb5...
I have already customised (and backed up) my setup1.exe to make a desktop icon - so I know how to change and recompile that, and I will use your help to further customise that.
I am however not adept at using the sendmessage function - if you can just elaborate somewhat on that.
Thank you for your accurate help.
My bigger problem is to customise P&DW so that one can exercise more options - like making desktop icons, startmenu icons and so on.
Do you think my approach to write my own program for that and only use P&DW for unpacking the cab file or should I rather customise the setup1.exe program ?
 
The SendMessage API with the WM_SETTEXT const. Quick example at
Well what ever you do in one program can be done in another if you get my meaning. The question is, do you want to support a secondary program that you shell from the setup1.exe to do these things and then have to wait on it (use friends (yahoo, google, ask, answers, bing) to search for vb6 shell and wait) or do you just want to have one interface where you could even add a form for the user to select options. Myself, I think I would just customize the setup1.exe so I would not have to go through adding the extra exe to the package, but that is me.



Good Luck
 
I wish to try this routine

Private Const WM_SETTEXT As Long = &HC

Dim l As Long, s As String
l = FindWindowEx(FindWindow("RECEIVER", vbNullString), 0, "TextBox", vbNullString)

s = frmSetup1.tag
SendMessage l, WM_SETTEXT, 0, ByVal s

My receiving form name is frmInstall and my receiving control name is lblResult

What should I fill in at "Receiver" and "textbox" in the example above - and is it the only 2 variables I need to change?

Thanks
 
Well a label does not have a hwnd so you need to use a textbox... Hold on here a moment and let me see what I can do to make this easy...

Okay, two projects...

Start a new standard exe project (Send), name form formSend, add text box (Text1), and add a command button (Command1). Size text box to hold a decent message. Then add this code...

[tt]
Option Explicit

Private Const WM_SETTEXT = &HC

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Dim TextBoxesHwnd As Long

Private Sub Form_Load()
Me.Caption = "Send"
If Trim(Command) = vbNullString Then
MsgBox "No Command Line Parameter Passed", vbOKOnly
End
ElseIf IsNumeric(Command) = True Then
TextBoxesHwnd = CLng(Command)
Else
MsgBox "Improper command line passed", vbOKOnly
End
End If
End Sub

Private Sub Command1_Click()
SendMessage TextBoxesHwnd, WM_SETTEXT, 0, ByVal Text1.Text
End Sub
[/tt]

Save project into an empty directory of your choice and then make the send.exe...

Start a second new standard exe project and add a text box (Text1) (size it to hold message), add a command button (Command1). Name the project Reciever and the form formRecieve. Then add the following code...

[tt]
Option Explicit

Private Sub Form_Load()
Me.Caption = "Recieve"
End Sub

Private Sub Command1_Click()
Shell App.Path & "\send.exe " & Text1.hWnd, vbNormalFocus
End Sub
[/tt]

Save the project into the same directory as the Send project and run. Click on the command button. This should spawn the Send.exe and pass it a command line paramter that contains the recievers projects textboxes hwnd. Type a message into the textbox of the send program and click on the command button. Instantly you should see the same message that you typed in the recievers programs text box...



Good Luck

 
This is getting a little crazy just to create a desktop shortcut. In any case it is ill-advised and violates Windows Application Guidelines:

Desktop
The desktop is the user's work area for their programs. It's not a way to promote awareness of your program or its brand. Don't abuse it!
They emphasize this with italics.

Besides, if necessary you would use VSI 1.1 which replaced the PDW back in 1999. Microsoft didn't strip the capability out of that. It is still a poor idea though.
 
This thread is now really getting interesting for me.

My options is then to customise the P&DW wizard and incorporate the desktop and other extra items in it - which I will now try.
I appreciate every contribution.

Thanks
 
I could not find the file in the archive.
I however found this comment regarding version 1.1 on another download site.

Windows XP contains Windows Installer 2.0 and therefore can't be installed or upgraded by this redistributable
 
vb5prgrmr meant to say that the link is for Visual Studio Installer 1.1... which is one of several P&DW replacements.

Windows installer is a different thing entirely.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top