shellm
Posts: 13
Joined: Thu Sep 28, 2017 2:04 pm
Contact:  Website

Install to network drive & temporary txt update

Thu Oct 05, 2017 4:28 pm

Hello guys,

two questions came up for me today.
First, I need my application to be installed on a network drive or a UNC path. To verify that, the best solution is probably to check the first char of the APPDIR , lets say it has to be either "\", "F","G","W" etc.
Assuming that Customers use a dedicated server for my software, there is ususally a maximum of two partitions and a dvd drive, which would add up to E:\, F:\ would be the first possible letter for a network drive.
How can i run this check at the time that the user proceeds to the next page of the installer?

Second: Is it possible to create temporary TXT Update sets or delete the files after the installer has finished everything else?
-> Context: I need to create a .cmd or .bat file with some user-defined parameters, including a password. Normally i would not bother about those 6KB txt files, but as there is a mySQL root-password written, I would like to delete the files asap after the installer has finished.

Thanks in advance!

(btw, your support is awesome)

shellm
Posts: 13
Joined: Thu Sep 28, 2017 2:04 pm
Contact:  Website

Re: Install to network drive & temporary txt update

Thu Oct 05, 2017 4:37 pm

Oh, and another thing: is it possible to then write the network drive to another parameter?

For example, the APPDIR is "W:\Software\WIAS\[ProductName]\" - can I save only the "W:\" into another parameter?

I also noticed, when installing to a Network drive and then creating desktop shortcuts to [APPDIR]\whatever.exe - It does not point the shortcuts to "W:\Software..." but to "\\[ComputerName}\Software..." - the according UNC path. This raises the question: can I retrieve the UNC path of the network drive too and put it into an additional parameter?
(I need all those paths to configure some services which need both for whatever reason - never change a running system)

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

Re: Install to network drive & temporary txt update

Wed Oct 11, 2017 3:21 pm

Hi,

I apologize for the delayed reply.
First, I need my application to be installed on a network drive or a UNC path. To verify that, the best solution is probably to check the first char of the APPDIR , lets say it has to be either "\", "F","G","W" etc.
Assuming that Customers use a dedicated server for my software, there is ususally a maximum of two partitions and a dvd drive, which would add up to E:\, F:\ would be the first possible letter for a network drive.
How can i run this check at the time that the user proceeds to the next page of the installer?
To achieve this, you can add a "Process data" custom action on the "Next" button of the "FolderDlg" dialog. That custom action will get the first character of the "APPDIR" property and place it into a custom property (e.g. use the "Extraction" type for this). Then you can use another "Process data" custom action of type "Matching" and have a Regex that see if the new property contains the characters you need placing the result in a new property.

After this, you can add a "Display message box" custom action that will be displayed based on the result property. If this is too complicated, you can create your own C++, C#, VBS custom action that does these checks and execute it on the "Next" button of the "FolderDlg" dialog.
Second: Is it possible to create temporary TXT Update sets or delete the files after the installer has finished everything else?
-> Context: I need to create a .cmd or .bat file with some user-defined parameters, including a password. Normally i would not bother about those 6KB txt files, but as there is a mySQL root-password written, I would like to delete the files asap after the installer has finished.
Yes, for this you can add an empty .cmd or .bat file in the "Files and Folders" page using the "Add Temporary Files" toolbar button, then add the a "TXT Update" file next to it. The empty file will be updated during the "Add Resources" action group, you can execute it and it will be removed during the "Finish Execution" action group after the "Install Finalize" standard action.
Oh, and another thing: is it possible to then write the network drive to another parameter?

For example, the APPDIR is "W:\Software\WIAS\[ProductName]\" - can I save only the "W:\" into another parameter?
You can can create a "Process data" custom action as explained above to achieve this.
I also noticed, when installing to a Network drive and then creating desktop shortcuts to [APPDIR]\whatever.exe - It does not point the shortcuts to "W:\Software..." but to "\\[ComputerName}\Software..." - the according UNC path. This raises the question: can I retrieve the UNC path of the network drive too and put it into an additional parameter?
(I need all those paths to configure some services which need both for whatever reason - never change a running system)
I'm afraid that I'm not aware of any way to get the UNC path. You may be able to achieve this through a custom action implemented by yourself.

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

shellm
Posts: 13
Joined: Thu Sep 28, 2017 2:04 pm
Contact:  Website

Re: Install to network drive & temporary txt update

Wed Oct 11, 2017 4:37 pm

Hi Eusebiu,

the first part worked great, now I just need to create a useful dialogue to display.
I will test the other things out tomorrow.

Thanks for your help!

shellm
Posts: 13
Joined: Thu Sep 28, 2017 2:04 pm
Contact:  Website

Re: Install to network drive & temporary txt update

Thu Oct 12, 2017 8:57 am

Good Morning Eusebiu,

it seems like everything works as you described, thank you for the tips.
I cant wait to get my hands on the Enterprise license I ordered earlier this week!

Greetings from Germany

shellm
Posts: 13
Joined: Thu Sep 28, 2017 2:04 pm
Contact:  Website

Re: Install to network drive & temporary txt update

Thu Oct 12, 2017 9:10 am

For some reason, when entering a Network Drive Path as APPDIR like "W:\WIAS\WIAS Enterprise" Advanced Installer immideately resolves this to the UNC Path. So I use the APPDIR in several other places, write it to the registry several times and even use it as a parameter for one exe file.
I can resolve this by just working around it with the ShareName Parameter I get with the custom actions you described. So I use [ShareName]WIAS\[ProductName] instead of [APPDIR].

It works, I can build installers like this, but this might be considered a bug in Advanced Installer.

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

Re: Install to network drive & temporary txt update

Tue Oct 17, 2017 2:02 pm

Hi,

Sorry for the delayed reply.

Indeed, I noticed that the APPDIR property is resolved to the UNC path when the Windows Explorer picker is used due to the "Enhanced User Interface" feature that is checked in the "Themes" page, "Settings" tab.

In order to keep the Network Drive path, you can add a "Set installer property" published event on the "Next" button of the "FolderDlg" dialog that stores the APPDIR property to another property. For example:
  • Property: PATH_PROP
    Value: [APPDIR]
Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”