esh
Posts: 1
Joined: Thu Oct 05, 2017 5:44 pm

Creating shortcut to external file with powershell

Hi.
I have created an installer with a few prerequesites and a powershell script.
The powershell script checks for a specific drive containing a specific file, and then returns the path value to a property.
I want to use this property to create a shortcut to this file.
The property is being set(i'm testing by outputting the property during stages of the installation), but the shortcut is still created with value {}(Specified at creation).

I'm wondering what i'm doing wrong. Are the values for the shortcut creation being set before the custom action is being run ?

I'm very new to this.

Thanks in advance :)
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Creating shortcut to external file with powershell

Hi and welcome to our forums.

Sorry for the delayed reply.

In order to achieve this, you can go in the "Files and Folders" page, create a "Shortcut to an external file" and write the PowerShell property in the "Shortcut target" field. Also, please make sure that the PowerShell script is run before the "Add Resources" action group in the "Custom Actions" page. If it is executed on the "Wizard Dialogs Stage" section please make sure that the property is a public property (its name contains only uppercase letters).

Let me know if this helped, otherwise give me more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”