Members
Technology Zones
IBM Learning Center
Articles
Hosted By
Info
|
[27] Package & Deployment Wizard
Last post 08-28-2007 7:55 AM by Suresh P. 24 replies.
-
-
buffbuh


- Joined on 09-23-2005

- Points 35
|
I understand that this is not a complete solution, but I found you had no other replies.
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
|
|
Advertisement
|
|
-
-
buffbuh


- Joined on 09-23-2005

- Points 35
|
I'm not sure I understand the question completely. I have packaged various .exe's in one package with one main .vbp file. I just added the other .exe's to the package as additional files. The main .vbp actually calls the other .exe's when appropriate using the following code:
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
|
|
-
-
buffbuh


- Joined on 09-23-2005

- Points 35
|
|
-
-
-
-
buffbuh


- Joined on 09-23-2005

- Points 35
|
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)
|
|
-
-
-
-
Thushan Fernando


- Joined on 09-28-2001
- Australia

- Points 11,005
|
Re: [27] Package & Deployment Wizard
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. 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
Digitally Yours,
Thushan Fernando
|
|
-
-
Suresh P


- Joined on 08-28-2007
- India

- Points 5
|
Re: related to package installation
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..
|
|
|
Search
Code Samples
New Members
|