mtilev
Posts: 44
Joined: Wed Dec 04, 2013 1:19 pm

Regular expression for selecting a set of archive files

Hello,

I am looking for a way for identifying a set of files within SETUPEXEDIR based on a regular expression pattern and storing them somehow within installer properties. The goal is to extract those files (zip archives) during installation (first time or upgrade) given the user has chosen so within the dialogs stage or given certain command line arguments by silent install. Those files are developed and provided separately from the installer package and thus can vary in number and names, but they all are named after the aforementioned pattern.

I would greatly appreciate any helpful ideas.

Thanks in advance and kind regards,

Milen
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Regular expression for selecting a set of archive files

Hello Milen,

I'm afraid we do not have any built in option for your requirements. However, you can try to develop your own custom action with such implementation, which will access the "SETUPEXEDIR" property value, run a search based on your regex on the above path and set the results into installer properties. You can have a look on our "How to set an installer property using custom actions" user guide article about how to access installer properties from your custom action code.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mtilev
Posts: 44
Joined: Wed Dec 04, 2013 1:19 pm

Re: Regular expression for selecting a set of archive files

Hello Daniel,

Thank you for your reply.

I will consider coding a custom action for that. I am concerned with the ability to give the user accurate feedback about the forthcomings of the archive extraction - in some cases the archive files can exceed 40 GB so the custom action would take a lot of considerable time and it would be important to provide some kind of a progress bar. I am not aware of a way to do this say out of a PowerShell script custom action. Do you have any idea regarding that?

Kind regards,

Milen
mtilev
Posts: 44
Joined: Wed Dec 04, 2013 1:19 pm

Re: Regular expression for selecting a set of archive files

There is one more question regarding the same installation procedure.

The to be extracted archive file may be placed together with the setup file in some scenarios on a network share accessible either through an UNC URI or a locally mapped drive letter. I am wondering how can I set up the custom action extracting the archives so that it has simultaneously the right to read from the network drive (this would require domain user privileges, which the installing user should have) and write to a UAC protected local path, say C:\Program Files (which as far as I remember requires elevated rights). Is it possible at the same time or is it mandatory to first transfer the large archives from the net drive to a local temporary cache location and extract them from there?

Thanks and kind regards again,

Milen
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Regular expression for selecting a set of archive files

Hello Milen,

I personally do not know how to thrown a progress bar during your PowerShell script execution, but you can try to implement the approach from "Add a Progress Bar to Your PowerShell Script" blog.

In what regards your last question, you can build your setup package as an EXE package type (check "Builds" page -> "Configuration" tab) and enable the "Run as administrator" option from "Install Parameters" page. This way the setup package will run elevated from the very beginning.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mtilev
Posts: 44
Joined: Wed Dec 04, 2013 1:19 pm

Re: Regular expression for selecting a set of archive files

Hi Daniel,

thanks for your replay, I'll give it a try with the article you've linked.

Will the elevated installer process still be able to access the network share using the user's credentials?

Thanks again and kind regards,

Milen
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Regular expression for selecting a set of archive files

Hello Milen,

I'm not sure. I think this will depend on the ACL set on the network share location.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mtilev
Posts: 44
Joined: Wed Dec 04, 2013 1:19 pm

Re: Regular expression for selecting a set of archive files

Hi Daniel,

what kind of ACLs are you thinking of? The user starting the setup is granted read access to the network share, however, the local system account will most probably be denied access to the share, is it this what you meen? Is there a way of achieving the copy on behalf of the user starting the setup while running in elevated mode?

Kind regards,

Milen
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Regular expression for selecting a set of archive files

Hello Milen,

Yes, I'm referring to the file permissions list set on the related location/files.

I'm afraid you cannot access the files from your custom action using the user context when the setup was launched elevated. The custom action will always run under the elevated user account context.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”