Custom Action only on install, rather than upgrade

Add-in Express™ Support Service
That's what is more important than anything else

Custom Action only on install, rather than upgrade
When performing a ClickTwice update, my uninstall custom action fires when removing the outdated addon 
Gary Garside




Posts: 15
Joined: 2012-10-19
Hi,

We're suffering from a bit of an issue that I hope someone else has managed to deal with in the past. Our app is pretty much finished. The addon itself functions fine and we've recently nailed the installation/update process using the ClickTwice web installer.

One of our clients requests was to open a webpage on install ("Thanks for installing,...") and a webpage on uninstall ("We're sorry to see you go,..."). I wrote these via a custom installer class for the which the project output is handled via custom actions in the installer.

The problem I now have is that when checkForUpdates detects a new version and the user downloads and installs it, in removing the old version my uninstall custom action fires and launches the "We're sorry to see you go" webpage.

Is there anyway I can check get the Installer class to check if the current process is an upgrade, rather than an actual uninstall?

Here's my Uninstaller class code, i've changed the urls for obvious reasons:

<Security.Permissions.SecurityPermission(Security.Permissions.SecurityAction.Demand)>
    Public Overrides Sub Install(ByVal stateSaver As System.Collections.IDictionary)
        MyBase.Install(stateSaver)
    End Sub

    <Security.Permissions.SecurityPermission(Security.Permissions.SecurityAction.Demand)>
    Public Overrides Sub Commit(
  ByVal savedState As System.Collections.IDictionary)

        MyBase.Commit(savedState)
        System.Diagnostics.Process.Start("iexplore.exe", "www.installpage.com")
    End Sub

    <Security.Permissions.SecurityPermission(Security.Permissions.SecurityAction.Demand)>
    Public Overrides Sub Rollback(ByVal savedState As System.Collections.IDictionary)
        MyBase.Rollback(savedState)
    End Sub

    <Security.Permissions.SecurityPermission(Security.Permissions.SecurityAction.Demand)>
    Public Overrides Sub Uninstall(ByVal savedState As System.Collections.IDictionary)
        MyBase.Uninstall(savedState)
        System.Diagnostics.Process.Start("iexplore.exe", "www.uninstallpage.com")
    End Sub


Many thanks in advance,

Gary
Posted 01 Nov, 2012 10:30:12 Top
Sergey Grischenko


Add-in Express team


Posts: 7202
Joined: 2004-07-05
Hi Gary,

That is why I have already added the ClickTwiceModule class to upcoming release of Add-in Express. The new release will be published this month. Can you please wait a couple of weeks?
Posted 01 Nov, 2012 15:25:48 Top
Gary Garside




Posts: 15
Joined: 2012-10-19
Hi Sergey,

Thanks for the upd ate. That sounds great, and I look forward to the update release.

Does the update also have the functionality to enable the se tup.exe internally download the projectname.exe file, rather than open a browser window, as mentioned elsewhere in the forum?

Kind Regards,

Gary
Posted 02 Nov, 2012 05:38:05 Top
Sergey Grischenko


Add-in Express team


Posts: 7202
Joined: 2004-07-05
Hi Gary,

No, setup.exe is still built via msbuild task.
Posted 02 Nov, 2012 05:54:16 Top
Gary Garside




Posts: 15
Joined: 2012-10-19
Ok, thanks for the quick response, Sergey :)
Posted 02 Nov, 2012 05:59:50 Top