/setproperty help - Advanced Installer Community
natecope
Posts: 38
Joined: Tue Feb 03, 2015 4:27 pm

/setproperty help

Hi there,
I'm trying to set a property based on another property. Is this possible?

Here is my command line:
AdvancedInstaller.com /edit project.aip /SetProperty MYEXEFULLPATH="[|APPDIR]\Myexe.exe"

Specifically, I'm having trouble getting the folder for the app. Is [|APPDIR] correct formatting in this case?

thanks
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: /setproperty help

Hi,

I'm afraid that this is not possible because the "APPDIR" property is not set at that point (it is empty). In order to have your property set to the "[APPDIR]Myexe.exe" value during the installation, you can go in the "Custom Actions" page and add a "Set installer property" custom action after the "Searches" action group.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
natecope
Posts: 38
Joined: Tue Feb 03, 2015 4:27 pm

Re: /setproperty help

Thank you for responding.

Is there another way to get the path to an installed file when uninstalling?

My use case is, I need to launch the executable with a /shutdown flag to shut down the application gracefully before uninstalling. Do you have any recommendations on how to do this? Obviously I can't hardcode the path, because the user may choose a different path when installing.

Going back to my original post, if I were to use the [APPDIR] property after the searches phase during uninstall, will the path then be available?

thanks,
-nate
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: /setproperty help

Hi,

This can be achieved following the steps below:
- go in the "Custom Actions" page and add a "Launch file" custom action after the "Install Execution Stage -> Preparing" action group
- right-click in the "File to launch" field, select "File..." and choose your executable from the dialog that appears
- writhe your flag in the "Command Line" field
- check only the "Uninstall" option from the "Execution Stage Condition" section
- build and run the project

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
natecope
Posts: 38
Joined: Tue Feb 03, 2015 4:27 pm

Re: /setproperty help

Thanks again for the reply.

So I'm using that custom action now. However, we're pulling the file name from a property instead of manually selecting it. We use lots of properties because we define so many different things at build time.

I've pasted a screenshot. Can you tell me if this would function correctly if placed after the preparing step?
Assuming APPDIR has its value and MYEXEPATH has its value? MYEXEPATH is actually just the name of the executable, fyi.

(for some reason I get a broken link if I post this as an image.)

https://www.dropbox.com/s/2m9pjl23fbtr4 ... e.PNG?dl=0
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: /setproperty help

Hi,
I've pasted a screenshot. Can you tell me if this would function correctly if placed after the preparing step?
Assuming APPDIR has its value and MYEXEPATH has its value? MYEXEPATH is actually just the name of the executable, fyi.
Yes, the way you configured your custom action should work, too.
(for some reason I get a broken link if I post this as an image.)
Our website is stored on two different servers and the broken link appears for few minutes, until the synchronization between the servers is done.

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

Return to “Common Problems”