Mark1701
Posts: 4
Joined: Thu Aug 22, 2019 12:40 pm

Using updatable properties in shortcuts and registry

Hi,

I'm trying to extract the major and minor version numbers from the ProductVersion property to create shortcuts, folders and registry keys based on the combination of major and minor.

I've tried to go though some of the existing posts threads but some are quite old and others don't really seem to solve my problem.

I've created two support properties:
MAJOR_VERSION
MINOR_VERSION
and used them as parameters for the creation of shortcuts, registry nodes, etc.

At the same time I created a custom action to run a script that updates those properties with the first and second parts of the ProductVersion field

This is my set-up for the Registry and it works well, the registry key is created with the correct major-minor value
screenshot_2.png
screenshot_2.png (18.58 KiB) Viewed 6326 times
This is my set-up for shortcuts and folders
screenshot_1.png
screenshot_1.png (15.96 KiB) Viewed 6326 times
... and it doesn't work since I end up with 0.0 as major and minor numbers

now I think this is caused by the fact that in this second case I'm using pseudoformatted properties (i.e. [|MAJOR_VERSION]) that are resolved at build time, while the custom action that populates the properties is executed at install time and it's helpful only for the registry.

but I couldn't find a way to use non pseudoformatted properties when creating folders or shortcuts, and scripts can't be run at build time.. so how can I solve this o_O ?
Catalin
Posts: 6598
Joined: Wed Jun 13, 2018 7:49 am

Re: Using updatable properties in shortcuts and registry

Hello Mark and welcome to Advanced Installer forums,

Please have a look on the following thread in which a similar scenario is discussed:

how to create MAJORVERSION.MINORVERSION folder under Application Folder.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Mark1701
Posts: 4
Joined: Thu Aug 22, 2019 12:40 pm

Re: Using updatable properties in shortcuts and registry

Hi Catalin,

Thanks for your reply.

I had a look at the list of steps from the other thread and they indeed produce a folder with the correct structure but I'm having problems with the shortcut creation. How can I create a shortcut with this structure:
[ProductName] [MAJOR_VERSION].[MINOR_VERSION]
under the Windows main menu and on the desktop?

The second problem is.. during the installation process users are prompt to choose a target directory, the suggested name does not match what I need but refers to the standard APPDIR and I couldn't find a way to change it (see picture below)
setup_path.jpg
setup_path.jpg (54.9 KiB) Viewed 6206 times
Catalin
Posts: 6598
Joined: Wed Jun 13, 2018 7:49 am

Re: Using updatable properties in shortcuts and registry

Hello Mark,
How can I create a shortcut with this structure:
[ProductName] [MAJOR_VERSION].[MINOR_VERSION]
under the Windows main menu and on the desktop?
I am not quite sure I understand what you mean here. Could you please give me some more details about what you want to achieve (maybe exemplify - e.g. some screenshots)?
The second problem is.. during the installation process users are prompt to choose a target directory, the suggested name does not match what I need but refers to the standard APPDIR and I couldn't find a way to change it (see picture below)
If I understand correctly, please correct me if I am wrong, you want to modify the APPDIR property during the install?

If that is the case, that can be achieved as it follows:

1. go to "Dialogs" page

2. select the "InstallDlg" and click on the "Install" button

3. under "Published Events" tab, create a new event by pressing the "New..." button, as it follows:

Set installer property value
Property: APPDIR
Argument: your path (even if it contains spaces, do not use quotes)
Condition: leave unchanged


This way, the APPDIR property can be changed during the installation.

If you want to change the default value of the APPDIR property (the one displayed as default in the "InstallDlg"), you can change it from the "Install Parameters" page --> "Application folder:" field.

Hope this helps.

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

Return to “Common Problems”