curt.blunt
Posts: 19
Joined: Tue Oct 18, 2022 11:05 am
Location: Remote

Dialog show only if....

Hi,

I want a dialog to ONLY show if the software is installed and the version matches 3.6.27.1 or lower..

Condition I am trying is Installed and CURRENT_INSTALLED_VERSION <= "3.6.27.1"

So the WelcomeDlg will display

I have a second dialog WelcomeUpgradeRebootRequired

My aim is to only show the above Dialog if our software is installed and the version detected is 3.6.27.1 or lower - I want them to uninstall and reboot from this dialog.

Reason being we have made some breaking changes with drivers and other things and all versions below this will need an upgrade AND a reboot BEFORE they install the next version.

1. Welcome Dialog - hello welcome to setup wizard
2. If installed and version is 3.6.27.1 show WelcomeUpgradeRebootRequired Dialog
3. This dialog will have a button saying "Uninstall & Force Reboot"

It needs to uninstall and kick the reboot off..

Upon logging back in, it would be very nice to automatically kick the original installer file off again, if not it would have to be a manual process

------------------

If they are installing 3.7.0.0

And they are on 3.6.27.2 or above then continue with standard uninstall / install behaviour no reboot is required

Reboots are required on 3.6.27.1 because driver will not detach properly and we would rather not kill file explorer during uninstall stage so feel it's better letting the customer reboot

Thanks
Curt
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Dialog show only if....

Hello Curt,

I am thinking we can achieve what you need with a search here.

If we take a look in the "Custom Actions" page, we can see the searches are executed before the dialogs are spawned and therefore it would be a perfect match.
Screenshot_46.png
Screenshot_46.png (15.19 KiB) Viewed 6444 times

Now, regarding the search type, it depends what you have set up already. For instance, if the version is in the registry, then we can perform a "Registry Search" for the version and then use the property that stores the search result as a condition.

Regarding the auto start of the setup, I would first advise testing this without doing anything because the setup might start automatically.

If it doesn't, on the "Uninstall & Force reboot" button, we can schedule a custom action that creates a scheduled task that launches the setup at user logon.

However, please note that the setup has to run elevated from the start in order for us to do this. Also, we have to make sure we have another cleanup custom action that deletes the scheduled task so the setup is not launched at every logon.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
curt.blunt
Posts: 19
Joined: Tue Oct 18, 2022 11:05 am
Location: Remote

Re: Dialog show only if....

Hey Catalin,

I've implemented a search now for installed_version and it works - it checks raw registry value of installed version in our registry location for our software.

I've created a dialog called WelcomeSetupWizard which is just a standard welcome to the installer...

I've created another Dialog with "show only if..." logic
INSTALLED_VERSION is below 3.6.27.2

This dialog is named UninstallAndRestartDetected

On this dialog I have a button = "Uninstall & Force Restart"

I need this button to do a few things...

1. Uninstall the software
2. When uninstall, show a dialog RestartPending with a button that says "Restart"
3. When they hit RestartPending dialog we need to create a registry key here -> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce

a string value needs to be created CDMRebootPending with date/time stamp as the value

The reason for this registry key is simple. On a restart all keys under that reg path get cleared, so we know that the user has restarted the machine when this CDMRebootPending is no longer there.

So let's say they have uninstalled and restarted.

When they launch 3.6.28.1 we need to check that the CDMRebootPending value doesn't exist & CDM is not installed - if that is the case, we can install the software fine and no issues.

How can we achieve the above?

Thanks
Curt
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Dialog show only if....

Hello Curt,

From what I can see, you have the same thread going with my colleague Danut over the email.

If possible, please continue this with him over there and if you have any other questions, do not hesitate to open a new thread and I will gladly assist.

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

Return to “Building Installers”