November Happy Hour will be moved to Thursday December 5th.

fredriktjarnberg
Jun 15, 2009
  5640
(1 votes)

Module Installation – Dealing with Regrets

If you’re an above average, EPiServer module installer developer you might have experienced writing a custom wizard for retrieving data. When doing so you take on a responsibility to handle cancellation, not only for your own script but for any script that is calling you (“install site with sql database” being one). This is easy to forget… I know from personal experience. The good news is that it is very easy to handle the event of user regrets (canceling your wizard) and here’s how":

In your PS script when calling the Show method on the wizard you need to get capture the return value.

$proceedWithInstall = $wizard.Show()

In order to terminate any active installer transactions you then need to look at the return value and if it’s false, you simply throw an exception to cause active transactions to rollback
 
if ($proceedWithInstall -eq $false)
{
throw(New-Object ApplicationException("User cancelled the installation"))
}

Not doing the above will make the surrounding script (Install site…) complete as if nothing happened.
Jun 15, 2009

Comments

Please login to comment.
Latest blogs
Optimizely SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog

I'm running Optimizely CMS on .NET 9!

It works 🎉

Tomas Hensrud Gulla | Nov 12, 2024 | Syndicated blog

Recraft's image generation with AI-Assistant for Optimizely

Recraft V3 model is outperforming all other models in the image generation space and we are happy to share: Recraft's new model is now available fo...

Luc Gosso (MVP) | Nov 8, 2024 | Syndicated blog