Optimum installation folder structure for a Windows application - windows

I have created an installation package using Wix which installs a Windows service on the user's machine. Currently, the files are being installed to [%ProgramFiles%\APLICATIONNAME].
Is this a future proof way of structuring an installation folder?
Should I be installing to [%ProgramFiles%\APLICATIONNAME\VERSION_NUMBER] instead?
Any recommendations would be greatly appreciated.
Thanks,
Arnie
Update:
Side-by-side installation of different versions will not be supported.

Version specific folders are no good. What you need to do is make sure all subsequent installers upgrade properly over the previous versions so that different folders are not required.
You may want to do something like ProgFiles\App 1.0 using the major and minor version number if you want to allow side by side installs of different versions. But with all of this it should ultimately be up to the user where the installed files end up.

As an additional note, if you are storing application data in the registry of the %AppData% folders then those are sensible places to use versioned folder names,
eg. %AppData%\Manufacturer\Application\1.0 and HKCU\Manufacturer\Product\1.0 or whatever.
We use this with a folder for each major release, this way if we decide to change our registry structure, rework data file formats, etc we only have to ensure compatibility between minor releases. Major releases can use a separate procedure to help the user migrate from a 2.x to 3.x release.

If side-by-side installation of different versions will not be supported I think [%ProgramFiles%\APLICATIONNAME] is good enough. However personally I prefer [%ProgramFiles%\COMPANYNAME\APLICATIONNAME].

Related

Upgrading software: installshield c# and. Net

I have a question concerning software updates. Currently I install new releases into a different folder each time. The user is then required to re-enter configuration parameters. This of course is not too optimal. The software is Windows forms and I use the settings. Settings file.
So the question is what happens if I install a newer version into the same folder as a previous install? Will files just get replaced? What about if I have added settings in the new version? Will they be merged?
Anything to watch out for?
Thanks
When the MSIs are related, typically you can only have one instance of it installed at a time. If that's the case, first the earlier version may be uninstalled, so the question is whether the files that store the settings are removed by uninstalling your MSI.
If the MSIs are not related, you can get into a world of pain by overlapping their installations (probably breaking component rules by having two different components describe the same file in the same location, but with a different component code), yet the core question comes down to the same thing: will the updated installation lay down the file that stores the settings.
These are likely the same question, as the easiest way to remove or install a file is by including it in the MSI directly. (There are other ways, but I'm assuming you're not using those yet.) If the file is not part of the installation, nothing will happen to it, and the answer to your question comes down to what your application does when it runs with a settings file created in a different version. If the file is part of the installation, and component rules are not being broken, it will either be uninstalled then freshly installed (wiping any configuration), or per File Versioning Rules and Default File Versioning, the file will either be left untouched or completely replaced with the new version. Windows Installer doesn't know how to merge your settings file.
Thanks for taking the time to answer my question.
So bottom line I should just avoid these issues and install in another folder. I should also make a copy of the settings and put them in my own file which can be used to update my new installation. That would be the safest route I guess.
Thanks

Installshield not updating related DLLs on minor upgrade

I'm currently working with InstallShield to deploy a .NET Winforms app. I am new to InstallShield and have not enjoyed the learning curve. The Winforms app has three related DLL's which are not getting updated during a minor upgrade. For a minor upgrade I am changing the version from 1.0.001 to 1.0.002 for example. The package code is being changed for each build automatically.
I have tried adding the dll's to the [INSTALLDIR] and setting the property to "always overwrite". For some reason this causes the upgrade to also not update the main exe.
Tried changing the product code to force a major upgrade. This installed a new version alongside the old version, but the new version still had the old dll's.
Tried changing ReinstallMode from "omus" to "vomus". This had no effect at all.
Tried using REINSTALL=ALL, REINSTALLMODE=vomus. This did not update the dll's and also caused new installs to fail with message that application "is not marked for installation".
Tried changing the version from 1.0.00x to 1.1.00x. dll's still not updated.
I notice that when I view properties of these dll files, they have File Version = 1.0.0.0 and Product Version 1.0.0.0. Do I need to manually increase these versions in order for InstallShield to recognize that they have been updated?
Use one component per file and set each file to be keyfile in its own component. This avoid all sorts of component referencing and file replacement issues. Be aware that multi-file assemblies must share the same component as they are intended as one "atomic" file system unit.
In addition you must also increment the version number for each build or set REINSTALLMODE to emus instead of the default omus. Never use amus.
My advice: go with the file version updates - it is much more reliable. Like you state the File Version is used, it must be incremented. I like to auto increment the build version number (last digit). It has been a while, but I think you just replace the number with * and it auto increments. I think you can do this from the Visual Studio project property view.
Maybe read up on the file versioning rules as well. Essentially versioned files are version compared, and for unversioned files the create and modify date stamps are compared and the file is replaced if it is unchanged on disk. More sample info.
Remove the "always overwrite" flag you enabled for all the files you enabled it for. This flag may work poorly with patches if you ever need them and also with other features.
When a major upgrade creates two side-by-side installations it hasn't worked. What you are left with are two different products installed at the same time. There is good inline help in Installshield itself with regards to how a major upgrade is set up. Which version of Installshield are you using? The version bundled with Visual Studio may not feature this help material.
A note on major upgrades and "reverted files":
A warning on a classic major upgrade issue: be aware that changed, unversioned files not set to be permanent on original install may be uninstalled during a major upgrade and then reinstalled yielding the impression that they have been replaced, but they are actually deleted and recreated. These are typically important settings files like XML files or similar - and people struggle with this issue a lot. Major upgrades are essentially a sequence. The old product is uninstalled, and then the new one is installed or vice versa. In the former case the files may be uninstalled first and then recreated. This does not happen in the latter case if component referencing is done right because the files that are matching between products are not uninstalled, but retained and then overwritten if need be (according to the file replacement / versioning rules).

Installation related questions

I am very new to creating installer packages for the company softwares. We are using InstallShield as building block.
I have below basic doubts:
1) What is the need to write the application data to registry?
2) When we release newer version of software, generally should we delete the older versions automatically and install new one?
3) What are the different things to take care in the lifecycle of instalaltions?
The applications data are entered into registry by the installer itself, it will be used for any future references. It has the version, GUID etc, which will be used during upgrades, uninstalling etc.
Its not necessary to delete the older files unless required. You can however set the options to uninstall previous version for upgrades.
You need to check the versions, GUIDs, upgrade information, if any hard-coded values etc.

VSS Deprecated Files

We are using VSS for version control (changing to another version control system is not an option right now), and are occassionally running into issues where a file has been completely deprecated with its functionality split into other new files. For historical archival reasons we need to keep those files in the version control sytem. Is there some way to clearly mark them as deprecated and no longer used?
Delete the files?
Deleting does not remove the historical versions - there is a separate command Destroy to do that.

Putting existing versions and branches of a project under version control

I am the only developer of a software project. I did not use any version control until now. I know I can put the last version of the project under version control. The question is whether it is possible to put older versions and branches of the project under version control. If it is possible, how ?
which version control software should I use ? (I am using Visual Studio 2008)
Edit: I have almost all previous versions.
You could do it, assuming you have copies of the older revisions that you want to put into source control (you can't magically make them appear, of course).
What I would do is take the oldest version, put it somewhere, and commit the folder to your source control (this would become Revision 1). Then, take the second-oldest version, overwrite the first version on your hard drive with that, then check in again (this becomes Revision 2 in source control). Repeat, overwriting with the next-newest revision each time until all of the versions you want are checked in.
There are good, free version control systems available. I use SVN (with the TortoiseSVN shell add-on), and I'm quite happy with it. CVS is alright too, but gets very slow as projects get large.
Which VCS you should use is really up to you. I'd recommend Mercurial as it is a very good distributed VCS and runs rather well under Windows. I don't know what VS support but you may want to use a supported VCS (which probably means Subversion I guess). There is TortoiseHg available there as well.
If you have all previous versions, you can import them manually, one after the other to get to the last one then work from that.

Resources