bidwars
Posts: 4
Joined: Mon Feb 21, 2022 3:27 am

Installing files to a folder that is a version number.

I am making an installer that will install a zip file into the following folder "c:\users\username\appdata\local\program\0.24\". The folder 0.24 is the version of another program. If you pull the program version from the registry it will show as 0.24.0.1. Is there a way to trim the ending values from the version number once you get the registry value? Also if the version of the other program changes will the installer be able to read the new registry value without me making a new installer program?

Thanks!
Catalin
Posts: 6584
Joined: Wed Jun 13, 2018 7:49 am

Re: Installing files to a folder that is a version number.

Hello and welcome to our forums,
Is there a way to trim the ending values from the version number once you get the registry value?
Sure thing. Now it depends on how you retrieve that value from the registry.

For instance, you can have a custom action that does both (retrieves the version and then trims it). The custom action can be either a script (PowerShell, VBS) or an executable/dll (C# custom action).
Also if the version of the other program changes will the installer be able to read the new registry value without me making a new installer program?
The answer to this is yes, but as long as the path to the registry does not change.

For instance, if your script retrieves the value from the following registry key:

Code: Select all

HKLM:\SOFTWARE\SomeKey
and then the path changes to:

Code: Select all

HKLM:\SOFTWARE\SomeKey\SomeSubKey
then you might need to modify the script accordingly.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bidwars
Posts: 4
Joined: Mon Feb 21, 2022 3:27 am

Re: Installing files to a folder that is a version number.

Thanks I was able to create a custom dll file to do this.
Catalin
Posts: 6584
Joined: Wed Jun 13, 2018 7:49 am

Re: Installing files to a folder that is a version number.

You are always welcome!

I am glad everything works as expected.

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

Return to “Building Installers”