Amin-egn
Posts: 9
Joined: Wed Nov 03, 2021 12:23 pm

Default installation folder in advanced installer

Wed Nov 03, 2021 12:26 pm

I wanna change default installation path in advanced installer v18.7, from C:\myApp to another volume like D:\myApp or E:\myApp and I used "Search", and set property to D:
it worked but it doesn't show D:\myApp (just show D:), and when target computer doesn't have D:\ it shows E:\APPDIR

What should I do?

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Default installation folder in advanced installer

Wed Nov 03, 2021 5:32 pm

Hello and welcome to our forums,

I am assuming that you are also setting the APPDIR property according to the search.

Your search only returns the drive letter (i.e. D:\) and therefore the encountered behavior is normal.

If you would like to set it to D:\MyApp, you should add the [ProductName] property when setting the APPDIR property, assuming "MyApp" is the name you define in the "Product Details" page --> "Name" field.

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

Amin-egn
Posts: 9
Joined: Wed Nov 03, 2021 12:23 pm

Re: Default installation folder in advanced installer

Thu Nov 04, 2021 7:58 am

Hello Catalin,

Thanks for your reply, but it didn't solve my problem.

myApp is a place holder.

Indeed I want to setting installation path to non-boot drive (actually C:\ always is boot drive) so it must install on the other ones like D:\ or E:\ or etc.
I attached some screen shots to explain more.

In Sreenshot(21), my computer hasn't drive D:\ and default path set to E:\APPDIR.


Appreciatively.
Attachments
Screenshot (21).png
Screenshot (21).png (899Bytes)Viewed 13029 times
Screenshot (17).png
Screenshot (17).png (46.15KiB)Viewed 13029 times
Screenshot (16).png
Screenshot (16).png (60.55KiB)Viewed 13029 times

Amin-egn
Posts: 9
Joined: Wed Nov 03, 2021 12:23 pm

Re: Default installation folder in advanced installer

Thu Nov 04, 2021 7:59 am

Hello Catalin,

Thanks for your reply, but it didn't solve my problem.

myApp is a place holder.

Indeed I want to setting installation path to non-boot drive (actually C:\ always is boot drive) so it must install on the other ones like D:\ or E:\ or etc.
I attached some screen shots to explain more.

In Sreenshot(21), my computer hasn't drive D:\ and default path set to E:\APPDIR.


Appreciatively.
Attachments
Screenshot (21).png
Screenshot (21).png (899Bytes)Viewed 13029 times
Screenshot (17).png
Screenshot (17).png (46.15KiB)Viewed 13029 times
Screenshot (16).png
Screenshot (16).png (60.55KiB)Viewed 13029 times

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Default installation folder in advanced installer

Thu Nov 04, 2021 2:50 pm

Hello,

First of all, please note that the "Application Folder" field from the "Install Parameters" page is actually linked to the APPDIR property.

Basically, the APPDIR property will take the value of that field.

Here is how you could achieve what you want, in a different manner.

You can leave the "Application Folder" field to have the default value, e.g.:

Code: Select all

[ProgramFilesFolder][Manufacturer]\[ProductName]
In "Dialogs" page, select the "FolderDlg" and under "Init Events" tab, add the following:

"New" --> "Set installer property value"
Property: APPDIR
Argument: [VOLUME_D]MyApp
Condition: VOLUME_D


Now please repeat the steps above after creating another search for the volume E, e.g.:

"New" --> "Set installer property value"
Property: APPDIR
Argument: [VOLUME_E]MyApp
Condition: VOLUME_E


This way, the APPDIR will be set to either D:\MyApp or E:\MyApp.

The only problem I see here would be if both drives exist on the machine. This way, the APPDIR will always be set to the second option (because this will overwrite the previous one).

Hope this helps!

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

Amin-egn
Posts: 9
Joined: Wed Nov 03, 2021 12:23 pm

Re: Default installation folder in advanced installer

Sat Nov 06, 2021 6:59 am

Hello,


Thank for your guidance, My problem solved.

One more question :D

I wish to display myApp end of the path wherever user select.
I mean that user wants to change drive and folder for example from default path (D:\myApp) user wants to install on F:\ProgramFiles, My installer
shows F:\ProgramFiles (install on F:\ProgramFile\myApp), I wish it shows F:\ProgramFiles\myApp.

Appreciately.

Amin-egn
Posts: 9
Joined: Wed Nov 03, 2021 12:23 pm

Re: Default installation folder in advanced installer

Sun Nov 07, 2021 9:37 am

Hello again,

How to check available space on drive ?

I took a look on the Init Events conditions and found OutOfDiskSpace.
I added it like this.

Property: APPDIR
Argument: [VOLUME_D]myApp
Condition: VOLUME_D AND (NOT OutOfDiskSpace)


but it had no effect.

Is there other way to automatically switch to next consider drive (not-boot and has available space) after drive C ?

Best Regards.

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Default installation folder in advanced installer

Tue Nov 09, 2021 10:44 am

Hello,
Thank for your guidance, My problem solved.
You are always welcome! Glad I could help.
How to check available space on drive ?
In order to do this, you can go to "Dialogs" page, select "FolderDlg" dialog and add on it the "Volume Cost List" control.
I wish to display myApp end of the path wherever user select.
In order to achieve this, you can proceed as it follows:

- go to "Dialogs" page

- expand "FolderDlg" dialog

- select "BrowseDlg"

- select the "Ok" button

- under "Published Events", add a "Set property" event as it follows:

Property: APPDIR
Argument: [APPDIR]MyApp
Condition: <leave unchanged>


PublishedEvent.png
PublishedEvent.png (127.53KiB)Viewed 12285 times


This way, after the user selects the path through the "BrowseDlg", the "MyApp" will automatically be appended to APPDIR.

Hope this helps.

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

Amin-egn
Posts: 9
Joined: Wed Nov 03, 2021 12:23 pm

Re: Default installation folder in advanced installer

Wed Nov 10, 2021 9:18 am

Thank you so much.

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Default installation folder in advanced installer

Wed Nov 10, 2021 3:09 pm

You are always welcome!

Glad I could help.

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

Return to “Building Installers”