Click here to Skip to main content
16,005,316 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionMultiline Crystal Reports (Wrap Word) Pin
| Muhammad Waqas Butt |21-Sep-05 5:19
professional| Muhammad Waqas Butt |21-Sep-05 5:19 
Questionneed free library for ftp over SSL using from vb.net? Pin
Tridip Bhattacharjee21-Sep-05 2:49
professionalTridip Bhattacharjee21-Sep-05 2:49 
QuestionHorizontal (row) listview Pin
Paul Farry21-Sep-05 2:45
professionalPaul Farry21-Sep-05 2:45 
AnswerRe: Horizontal (row) listview Pin
Steve Pullan21-Sep-05 14:20
Steve Pullan21-Sep-05 14:20 
QuestionCustom deployment Pin
Member 167425921-Sep-05 0:34
Member 167425921-Sep-05 0:34 
AnswerRe: Custom deployment Pin
Paul Farry21-Sep-05 2:49
professionalPaul Farry21-Sep-05 2:49 
GeneralRe: Custom deployment Pin
Member 167425921-Sep-05 6:39
Member 167425921-Sep-05 6:39 
GeneralRe: Custom deployment Pin
rwestgraham21-Sep-05 12:20
rwestgraham21-Sep-05 12:20 
OK, you have various options:

First of all, in reference to a previous post, VB.NET Installer classes do not run until the very end of the installation, so they are not useful for uninstalling a previous app in most cases. Plus you are developing in VS6. No insult intended to the previous psoter, but I would eliminate that "option" as unviable.

Starting with viable options:

The only really easy one is to tell the user they need to uninstall the previous application before they install the new one. Not a very polished approach, but it is the only one that does not require CONSIDERABLE effort on your part.

Installshield is a powerful installation application, but it has a steep learning curve. You would still have to manually write the script code to uninstall the previous version. Plus it is very expensive. Wise is also very expensive. If you are going to invest in professional grade installation tools, go with InstallShield. It is a little more than Wise, but if you are going to shell out the bucks for either, go with the top of the line.

You have several other options:

1) If you are a decent programmer in C++ you can write your own bootstrapper. The "Setup.exe" included when you build a setup in VB6 with the P&D Wizard is a bootstrapper. Basically a bootstrapper is a pre-setup program that is written in C++ taking care to only use core system functionality - Windows APIs that you know will always be available on any systenm running Windows. In the case of VB, the bootstrapper installs the VB Runtime - that is essentially because the setup you actually see when you run a VB6 setup is also itself written in VB - it's called "Setup1.exe". If the VB runtime is not already installed, a VB setup will not run. So the bootstrapper installs the VB runtime then launches Setup1.exe which then actually runs the install.

If you write your own bootstrapper, you can replaced the standard Setup.exe with your own, written so that it looks for the installed app, uninstalls it, bootstraps the Setup1.exe, then the rest of your install is the normal VB setup. There is really only one difficult part of writing your own bootstrapper - it has to be able to extract the VBRuntime files from the CAB. You may be able to find someone who has already written code that will extract files from a setup cab, but personally, I've looked tried to do this myself and ran out of patience with it. The documentation on working with windows setup cabs is pretty damn obtuse.

The option just described requires a pretty fair amount of work.

2) You can avoid doing this by writing a C++ "pre-bootstrapper" that does nothing but removes the existing app, then launches the regular Setup.exe bootstrapper. This is a much easier task - no cab extraction needed. But this works only if you can "hide" the regular Setup.exe in a subfolder. A user sees "Setup" that's what they'll click to run the setup. So your "pre-bootstrapper" needs to be named "Setup" or something like it. If you try to fool the user by renaming the standard "setup.exe" to something else, it no longer works - I've tried this. If you are distributing CDs, this is not a problem - just put your VB Setup.exe and it's components in some non-obvious subfolder. If you are using a zip, they could always unzip without using the kepp folder name options. So to be prepared for this, you would have to rename Setup.exe to some spurious name, name your pre-bootstrapper to something like "SetupMyApp.exe" so you don't have to worry about moving stuff around to avoid a name clash, then write code in your prebootstrapper to rename the other file to Setup.exe before you run it.

This is your simplest C++ option if you are at least a fair C++ programmer and you don't mind having to rename or move stuff around if needed.

3) To avoid C++, you can modify your Setup.LST file to instruct the Setup.exe to run some VB program other than Setup1.exe. This VB program would have to find the old app, uninstall it, then run the regular Setup1.exe to install the new app. This is doable, and in my opinion probably your best option if you want to use VB6 code to uninstall the other app. There are some tricks - you have to tinker with the setup.lsts and you have to get the files in the right places, and you have to configure a command line correctly to subsequently run Setup1.exe. But this is a good option.

One drawback is your VB6 program that does the uninstall will never be uninstalled itself. So, OK, lots of setups leave file sbehind. You can modify your Setup1 to get rid of this file if you really want to.

4) You can modify the Setup1.exe program. It is written in VB6 and VS installs the source code. So you can add code to Setup1.exe to find the old app and uninstall it. This is also doable - but the source code is also a bloody mess, and hard to work with. This is a good option in some respects - you have the least amount of tinkering around with manually changing files etc. The downside is the Setup1 code is friggin' Chinese puzzle.

Whew! I'm tired. Are you?

This is not easy, and I will not even attempt to start on the "check for updates question." That is an application in itself. And usually that is done by the app itself, not during the install.

If you want to tackle any of the above, you can send me specific questions that are not likely to be answered on the forum.
QuestionHow to retrieve excel data from vb? Pin
Anonymous20-Sep-05 19:51
Anonymous20-Sep-05 19:51 
AnswerRe: How to retrieve excel data from vb? Pin
Dave Kreskowiak21-Sep-05 8:04
mveDave Kreskowiak21-Sep-05 8:04 
Questionunicode utf -8 in iis 6.0 server 2003 Pin
ybasha20-Sep-05 19:39
ybasha20-Sep-05 19:39 
QuestionDo your research BEFORE posting Pin
Steve Pullan20-Sep-05 19:37
Steve Pullan20-Sep-05 19:37 
AnswerRe: Do your research BEFORE posting Pin
toxcct20-Sep-05 21:52
toxcct20-Sep-05 21:52 
GeneralRe: Do your research BEFORE posting Pin
Steve Pullan21-Sep-05 13:50
Steve Pullan21-Sep-05 13:50 
AnswerRe: Do your research BEFORE posting Pin
Alsvha20-Sep-05 22:13
Alsvha20-Sep-05 22:13 
GeneralRe: Do your research BEFORE posting Pin
Steve Pullan21-Sep-05 14:01
Steve Pullan21-Sep-05 14:01 
AnswerRe: Do your research BEFORE posting Pin
forecourt21-Sep-05 6:37
forecourt21-Sep-05 6:37 
GeneralRe: Do your research BEFORE posting Pin
Colin Angus Mackay21-Sep-05 6:58
Colin Angus Mackay21-Sep-05 6:58 
GeneralRe: Do your research BEFORE posting Pin
forecourt21-Sep-05 9:10
forecourt21-Sep-05 9:10 
GeneralRe: Do your research BEFORE posting Pin
Colin Angus Mackay21-Sep-05 11:55
Colin Angus Mackay21-Sep-05 11:55 
GeneralRe: Do your research BEFORE posting Pin
Steve Pullan21-Sep-05 14:13
Steve Pullan21-Sep-05 14:13 
AnswerRe: Do your research BEFORE posting Pin
Christian Graus21-Sep-05 10:34
protectorChristian Graus21-Sep-05 10:34 
GeneralRe: Do your research BEFORE posting Pin
Steve Pullan21-Sep-05 14:11
Steve Pullan21-Sep-05 14:11 
GeneralRe: Do your research BEFORE posting Pin
Christian Graus21-Sep-05 14:14
protectorChristian Graus21-Sep-05 14:14 
AnswerRe: Do your research BEFORE posting Pin
S Douglas22-Sep-05 0:54
professionalS Douglas22-Sep-05 0:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.