A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

fredriktjarnberg
Jun 15, 2009
  5915
(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
CMS Audiences - check all usage

Sometimes you want to check if an Audience from your CMS (former Visitor Group) has been used by which page(and which version of that page) Then yo...

Tuan Anh Hoang | Dec 12, 2025

Data Imports in Optimizely: Part 2 - Query data efficiently

One of the more time consuming parts of an import is looking up data to update. Naively, it is possible to use the PageCriteriaQueryService to quer...

Matt FitzGerald-Chamberlain | Dec 11, 2025 |

Beginner's Guide for Optimizely Backend Developers

Developing with Optimizely (formerly Episerver) requires more than just technical know‑how. It’s about respecting the editor’s perspective, ensurin...

MilosR | Dec 10, 2025

Optimizely PaaS Administrator Certification : Free for Everyone

Optimizely has recently launched a free PaaS Administrator Certification. https://academy.optimizely.com/student/activity/2958208-paas-cms-administ...

Madhu | Dec 9, 2025 |