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

Deployment/Custom action question 1

Status
Not open for further replies.

SavantMan

Programmer
Apr 17, 2002
165
US
I have a deployment project that I'm setting up. I need to perform a different custom action based on whether this is a first time install or an update. Does anyone have any idea if it's possible to set the Condition property of a custom action to determine if the currently running install is upgrading a previous installation and if so how? I'm also open to other methods of acheiving this functionality.
 
Why not put a value in the registry during the install. If the value exists, you can read it and then decide on what you want to do.
 
The problem is this is a deployment project that may or may not be upgrading a previous installation --- I need to determine during this installation if it's an upgrade or not.
 
I think that ralphtrent has got it with his answer, this is how most other software dev's do it.

If you look in the registry under any app you will see a version number, this tells their install software if its an upgrade or new install...
 
When you run the install you put in a registry key, but before you do that, you check to see if one exists that may be been put there by a previous install. Does that make more sense?
 
The answer makes sense, but the problem that I have is I apparently know little about deployment projects in general. I'm not sure where or how to track a variable from the beginning of the install process to the end. I suppose I could create a custom action that would set the reg key and the beginning, but where would I store the value that determined if a key existed previously? Also, in this case, there will never be a pre-existing key as previous installations of my application never set it in the first place, which means it would always be treated as a first time install, which wouldn't necessarily be true.

Due to time constraints, I've had to find the necessary information another way. I've modified the final custom action to request input from the user to determine whether the "first time install" or "upgrade" path should be taken. Obviously not the best solution.
 
maybe going forward you can use the registry option. You can create a custom registry key and place the value there. When you run your install, you would check to see if the key exists, if it does not, then you would treat as a new install and then put the key in the registry. The next time you run the install, your install will check to see if the key exists, in this case it does, it will then treat the install as an upgrade. Im sure if you google custom deployment actions you will see how to add info to the registry.
 
thanks for your help --- sounds like I've got a bit of research to do for future installs
 
Yes, i have done a similar thing for a web project where I store the database connectivity information in the registry based on what the user enters in the install screen. If you would like to see the code, let me know. I can try to post it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top