sramesh
Posts: 20
Joined: Sat Mar 08, 2008 8:23 pm

Custom Upgrade

Hi,

I have a project that installs a wsp and then runs some commands in Sharepoint to complete the installation process.

My difficulty is during an upgrade. During an upgrade, I do not want to uninstall (remove) any of my previously installed files except the wsp. Once that is done, I also have to run some commands in Sharepoint to complete the upgrade. I also need to ensure that the product is not registered twice in the control panel.

As per my understanding,
I cannot use a patch because I cannot run the custom action commands from a patch.
I cannot do an upgrade as it will uninstall my previous version and install the newer version. (I will loose user data if I uninstall). Can't have that.

What are my options ?

Can anyone please help !

Thanks in advance.
SR
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Custom Upgrade

Hi,

What you need can be done by using the automated upgrade feature to upgrade the old versions of the package. In order to keep the original files, you need to set the "Permanent" and "Never Overwrite" attributes for the components in the Organization page of the old package. Note that these attributes must not be set for the components you want to upgrade.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sramesh
Posts: 20
Joined: Sat Mar 08, 2008 8:23 pm

Re: Custom Upgrade

If I use the automated Upgrade feature, then my previous version will be uninstalled. I should not uninstall the previous version. (My uninstall custom action will command sharepoint to remove the files from there and that will cause the user to loose data).

I want to replace only 1 file (a wsp). But I do not want to uninstall as part of the upgrade process.

But I also want to do some custom action after replacing the original file.

Please help.

Thanks in advance
SR
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Custom Upgrade

Hi,
If I use the automated Upgrade feature, then my previous version will be uninstalled
This is why I mentioned the "Permanent" and "Never Overwrite" attributes (the components will not be removed during an uninstall and they will not be overwritten). Also, the uninstall custom actions can use this condition to not run during an upgrade:

Code: Select all

REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE
However, an easier approach is to use a patch to update the file. If you want to run a custom action during a patch, you need to make sure that it is included in the Upgraded package. Also, the custom action must use the condition PATCH.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sramesh
Posts: 20
Joined: Sat Mar 08, 2008 8:23 pm

Re: Custom Upgrade

I will try that. Thank you.

Will I be able to Install / upgrade depending on if its already installed or not using one single msi ?

Please let me know .

Thanks
SR
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Custom Upgrade

Hi,

If you are using the automated upgrade feature then the upgraded package can upgrade an existing installation or perform a clean one. However, a patch can only upgrade an existing installation (it cannot perform a full installation).

Note that both features imply using multiple versions of the same installation package.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sramesh
Posts: 20
Joined: Sat Mar 08, 2008 8:23 pm

Re: Custom Upgrade

I am attempting the Automated Upgrade feature.

But when I upgrade it seems to run my uninstall custom code. Is there any other thing I need to consider.

My execute condition for running the uninstall custom action is (REMOVE="ALL" AND (NOT UPGRADINGPRODUCTCODE))

Please help.

Thanks
SR
sramesh
Posts: 20
Joined: Sat Mar 08, 2008 8:23 pm

Re: Custom Upgrade

cosmin wrote: This is why I mentioned the "Permanent" and "Never Overwrite" attributes (the components will not be removed during an uninstall and they will not be overwritten).
I apologize for misleading. I do want to replace all of my old files when upgrading. But I do not want to uninstall or run the Uninstall custom action.
cosmin wrote: Also, the uninstall custom actions can use this condition to not run during an upgrade:

Code: Select all

REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE
This is not helping. Even though I have this execution condition for my custom action in uninstall, the uninstall custom action is being executed.
cosmin wrote: However, an easier approach is to use a patch to update the file. If you want to run a custom action during a patch, you need to make sure that it is included in the Upgraded package. Also, the custom action must use the condition PATCH.
I gave this a try. I created a patch using my old version and new version.
Where should I include my custom action ? Should I create a new project and add the custom action in that new project and also include the MSP file ?

Please help

Thanks
SR
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Custom Upgrade

Hi,
Even though I have this execution condition for my custom action in uninstall, the uninstall custom action is being executed.
I'm not sure why you are encountering this behavior. Can you please send us the two AIPs (the old version and the new version) to support at advancedinstaller dot com so we can investigate them?
Where should I include my custom action ?
I'm not sure I understand this question. Note that the target and upgraded images of a patch are very similar to the packages used by the automated upgrade feature. The only differences are:
- for a patch the target and upgraded packages use the same Product Code
- the target and upgraded packages must meet the patch rules
Should I create a new project and add the custom action in that new project and also include the MSP file ?
Please note that a MSP file (a patch) can be applied directly to an installed target package. Basically, in order to create a patch you can follow these steps (explained in the patch tutorial):
- you do a back-up of the AIP of the first installation
- you open the AIP of the first installation in Advanced Installer
- in the "Product Details" page you increase the version (in the "Product Version" field)
- after you select another page you are prompted about changing the Product Code
- in this dialog you select "No" because the target and upgraded packages must have the same product code
- you update the package (add/remove/modify files, registry keys, custom actions etc.)
- you save and build the project (the target and upgraded packages must have the same name, for example: "test.msi")
- in Advanced Installer you create a Patch project
- you set the target (old MSI) and the upgraded (updated MSI) packages (you can use the wizard or you can set them in the "Images" page)
- you build the project

After installing the target image (the original package), you can run the patch (MSP file) to update it to the upgraded image (the upgraded package). Note that any custom action in the upgraded image which has the condition PATCH will run when the patch is applied.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sramesh
Posts: 20
Joined: Sat Mar 08, 2008 8:23 pm

Re: Custom Upgrade

Hello,

After your suggestions, I am attempting the patch approach.

I have the original release version 15 using AI 6.1.1.
The following changes were to be done to this original release aip.

Need to add Files/components. So created a new feature and added the files there.
One of the dialog box needs to be changed in functionality.
New UI custom action included when click next button, some validation to be done.
3 new custom actions included (all defined in the new feature) in the Install finalize Sequence after the original custom actions.
These 3 new custom actions have execute condition (PATCH).

I created the upgrade exe with these changes. Then created an MSP using the original and this new upgrade exe. When I run the MSP, it fails during the Uninstall.

Looks like it is not able to find the file needed for uninstall custom action. Firstly, I do not want it to run the uninstall custom action. Secondly, I do not understand why my patch fails at that spot.

My original aip for version 15 had Uninstall custom action with Execute condition Remove = "ALL"

Is this the cause of my grief ? if so, How do I modify the execute condition of my uninstall custom action in my target machine ?

Please help !! :cry:
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Custom Upgrade

Hi,
One of the dialog box needs to be changed in functionality.
New UI custom action included when click next button, some validation to be done.
Please note that changing the UI of the upgraded package will be meaningless for the patch. This is because the patch will use only the dialogs specified under the "Patch" directory in the "Dialogs" page.
Looks like it is not able to find the file needed for uninstall custom action. Firstly, I do not want it to run the uninstall custom action. Secondly, I do not understand why my patch fails at that spot.
Can you please send us a working test case to support at advancedinstaller dot com so we can investigate it? The test case should contain:
- the AIPs of the target and upgraded packages
- the target and upgraded installation packages
- the AIP of the patch
- the MSP file (the patch)
My original aip for version 15 had Uninstall custom action with Execute condition Remove = "ALL"
Is this the cause of my grief ?
A custom action which uses the condition REMOVE="ALL" will be executed only when the package is uninstalled. Since this doesn't happen when a patch is applied, most likely there is something wrong with the patch or the target and upgraded packages.
How do I modify the execute condition of my uninstall custom action in my target machine ?
Please note that an installed package cannot be modified. If you have a broken installation (a package which cannot be uninstalled), you can remove it with the Windows Installer CleanUp utility.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Custom Upgrade

Hi,

Starting with version 8.3 Advanced Installer offers support for installing, maintaining and upgrading SharePoint solutions. So you no longer need to use custom actions or workarounds.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”