Library tutorials & articles
Package & Deployment Wizard
Introduction
Once you have created your VB program, you need a way to distribute it to your users. You could create your own setup program, or purchase a third party program to do it for you. However, the first would be very time consuming, and the second would be very expensive.
An alternative option is the Package & Deployment wizard that is bundled with Visual Basic. It allows you to create a setup program for your application in a few minutes. It is not amazingly flexible, but is fine for most basic applications. This tutorial will show you how to use it.
Related articles
Related discussion
-
VB6, SQL 2005 & DMO
by elajaunie3 (1 replies)
-
sending sms from pc
by sriraj20074 (0 replies)
-
Automating Excel from VB6.0
by epurdy (0 replies)
-
VB6 system conversion using VBA to Word 2007
by b.macgregor@vodamail.co.za (0 replies)
-
video not working with visual basic
by Jupiter 2 (9 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
Hello
Open the folder(Package folder) where .exe file is available..
There one setup file is available open that setup file in notepad..
In that below the Setup1 Files, search the word DLLSelfRegisterEx..
Remove the letter Ex and save the file..
Now install & execute.. Send respose..
I keep seeing people post on the forums about P&D issues, P&D Wizard was great when VB6 first arrived (around 98) but after Microsoft invested in MSI (Windows Installer) P&D was pointless.
![Big Smile [:D]](/emoticons/emotion-2a.gif)
To save yourself (and your users) the trouble switch to using Visual Studio Installer 1.1 or one of the other freely available installers such as InnoSetup or NSIS Installer. You'll find that these tools are more robust and alot more user-friendly than the older v3.x versions of the installer shell/runtime that P&D uses.
I hope that helps
No problem, Sallen. I'd be happy to help out if I can. I remember looking a while for answers for a while and finally gave up. Let me know if you found a legitimate solution. Good luck!
Bryan
Thanks Bryan. I'm going to have to do some research and recommend to my team what we do to resolve the issue. We've been talking about going to a different PDW for quite some time and as you say this may be our straw that broke the camel's back. I'll give the free one a look over and if I have any questions I'll be in touch--if you don't mind.
Thanks,
Sondra
SALLEN,
I don't think I ever found a solution. But read on if you want an alternative solution.
I decided I wanted a more professional software installation package anyways, that offered more options and looked nicer - and I wanted it in .msi format, so I tried out MAKEMSI, a free software packaging tool, and have been using that to package my software ever since.
There's a learning curve there, but I'd be willing to share what I've learned as far as packaging a VB project using MAKEMSI. Granted, my VB package is not too complicated. I include a number of VB executables, a DLL library, an .mdb file, and .ini file. Added a banner graphic, icon, and software license text. It's really not a bad way to go for free.
I have used Wise Installer, which is much better/easier to use, but costs quite a bit of money. I might recommend that to someone with money to buy it.
Sorry I don't have a fix for you. I guess that's the straw that broke the camel's back for me. I couldn't believe VB packager would hang up like that. GRRRRR!!!
Sincerely,
Bryan (BuffBuh)
Is there a resolution for this issue? I'm having the same problem.
Thanks,
SALLEN
Help!
Buffbuh
Good idea to do a search in Google on error messages - you'll often find links to Microsoft's Knowledge Base - good place to start.
Buffbuh
Dim strMyShell As String
strMyShell = registry("strPath") & "Other.exe"
If FileExists(strMyShell) Then
Call ExecCmd(strMyShell, 0) ' Second byte parameter determines whether parent .exe waits or not for "Other.exe" to finish before continuing.
Else
Err = 5
ErrorOut Err, "'" & strMyShell & "' does not exist. Get a copy and put it in the right directory."
End If
Where:
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Private Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessID As Long
dwThreadID As Long
End Type
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal _
hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function CreateProcessA Lib "kernel32" (ByVal _
lpApplicationName As Long, ByVal lpCommandLine As String, ByVal _
lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, _
ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, _
ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, _
lpStartupInfo As STARTUPINFO, lpProcessInformation As _
PROCESS_INFORMATION) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal _
hObject As Long) As Long
Private Const NORMAL_PRIORITY_CLASS = &H20&
Private Const INFINITE = -1&
Public Sub ExecCmd(cmdline$, bytWait As Byte)
' From VB article Q129796
Dim ret&
Dim proc As PROCESS_INFORMATION
Dim start As STARTUPINFO
' Initialize the STARTUPINFO structure:
start.cb = Len(start)
' Start the shelled application:
ret& = CreateProcessA(0&, cmdline$, 0&, 0&, 1&, _
NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)
If bytWait = 1 Then
If ret& = 0 Then
Err = 8
End If
' Wait for the shelled application to finish:
Do
ret& = WaitForSingleObject(proc.hProcess, 0)
' ret& = WaitForSingleObject(proc.hProcess, INFINITE)
DoEvents
Loop Until ret& <> 258
ret& = CloseHandle(proc.hProcess)
End If
End Sub
I have had problems doing this, but have found a nasty, unprofessional work-around.
First - create the shortcut, save it in folder.
Second - Normally, a shortcut has extension "*.lnk", right? Well, you have to change the extension to say "*.txt", making sure the file is not really "*.txt.lnk". This may be accomplished via a command window with the rename instruction.
Third - When packaging, add this file to your install package. On the screen where destination folder is designated, you need to enter "$(App.Path)\..\..\All Users\Desktop", going back however many folders from the designated App.Path.
Fourth - This is the nasty part - after installing, the "txt" file will be copied to the desktop. Now you simply have to rename it via windows to "*.lnk". That will make it a shortcut and replenish the appropriate icon.
This is the closest to "automatic" I have come up with using VB's Package and Deployment Wizard. If anyone has found a better way to do it, please let us know!
Buffbuh
I have two projects with two exe. Example A.exe and B.exe. Suppose I want to run A.exe first and then B.exe. Is it possible to tell Packege and Development while intalling Run A.exe first?
thanks
In same package folder setup.lst file willl be there
open this file using notepad. search for DllSelfregisterEx and just remove Ex
this accurs if you use Calender control
I have created one pakage in VB. but while installing that pckage at the end stage it will give error like 'c:\windows\temp\msftqws.pdw\$(DLLselfRegisterEx) could not be registered b'se it was not found. how to solve this?
While using the package and development wizard I would like to know how is it possible to add a shortcut on my project automatically in the desktop during setup.
Here's an easier way. Add the files from the folder you need, leave the destination to $(AppPath). When the P&D is done, edit the SETUP.LST file. Just put \Folder after the $(AppPath), copy and paste to the remaining lines.
I used the VB Package & Deployment Wizard for my projects, but i have this problem :
The process of installation becomes with English, but the uninstallation of my VB programs becomes with Spanish dialogues.
How can fix this problem?
(I have Windows 98 SE Greek)
Is there any way to include a directory in that shit package?
Hi,
I m in same problem. I have a many pictures which is to be included in one folder kindly tell me how can i add all pictures (about 8000) in one folder.
my emailid: deepakbisht@gmail.com
thanks
Deepak
What About Adding More Than 1 Folder?
Pal I found a way to add a folder in a package.
When the wizard ask you to add any additional files add your files one by one. After some "nexts" it will ask you to write where to install every file. There you will see as a destination the $(AppPath), change this for your custom files as $(AppPath)\FolderName to install your pics in desired folder. It takes a long if you have a lot of files but it's the only way I found.
I hope this helps!
cheers
Did you ever find out how to add a folder to a vb package?
can somebody refer me to a free BETTER P&D wizard then the one that is shipped with visual basic ?
Hi
I am making a VB package I have to ship one folder which contains lots of images.
Can u tell me how i can package this folder in the set up.
Hi
I am making a VB package I have to ship one folder which contains images
Can u tell me how i can package folder in the set up
thnx
This thread is for discussions of Package & Deployment Wizard.