milos
Posts: 1
Joined: Tue Jul 16, 2024 2:50 pm

Handling SQL EXPRESS Prerequisites Based on installation key

I'm trying to set whether the SQL EXPRESS prerequisites are installed based on the installation key. I've created a custom SerialKeyDlg that appears in the Pre-install UI before PrerequisitesDlg, where certain custom actions are executed, including one that creates the registry entry InstallSQL = "True".

I have two problems:

1. The prerequisites check is performed before the setup is launched, as I understand it, and when the registry entry is created during key input, it's already too late. I tried executing a simple .bat file that checks the value in the registry, but it doesn’t work either. It works during testing, but during installation, when custom actions are executed and the registry entry is created, it doesn’t work. Instead, it remembers the state before the installation started. Do you have any idea how to solve this?

2. During testing, I encountered the following problem. No dialog from the Pre-install UI is displayed if the prerequisites are already installed and the rest of the installation isn't finished. Is there an option to always display this, because if I installed the prerequisites where SQL EXPRESS isn't needed and then changed my mind and now want to install the SQL EXPRESS prerequisites, I don’t have that option.

Regards,
Milos.
Catalin
Posts: 7513
Joined: Wed Jun 13, 2018 7:49 am

Re: Handling SQL EXPRESS Prerequisites Based on installation key

Hello Milos and welcome to our forums,
2. During testing, I encountered the following problem. No dialog from the Pre-install UI is displayed if the prerequisites are already installed and the rest of the installation isn't finished. Is there an option to always display this, because if I installed the prerequisites where SQL EXPRESS isn't needed and then changed my mind and now want to install the SQL EXPRESS prerequisites, I don’t have that option.
If the prerequisite is already installed, then the pre-install dialogs will no longer appear unless you have one more prerequisite that has to be installed.
1. The prerequisites check is performed before the setup is launched, as I understand it, and when the registry entry is created during key input, it's already too late. I tried executing a simple .bat file that checks the value in the registry, but it doesn’t work either. It works during testing, but during installation, when custom actions are executed and the registry entry is created, it doesn’t work. Instead, it remembers the state before the installation started. Do you have any idea how to solve this?
One solution for this would be to schedule the prerequisite as "during main package".

This way, the prerequisite will be launched when the user clicks on the "Install" button and you will have plenty of time to retrieve the key and check for its' existence.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”