Regular expression for selecting a set of archive files

Need help authoring your installer? Ask the community for tips and advice.
mtilev
Posts: 44
Joined: Wed Dec 04, 2013 1:19 pm

Regular expression for selecting a set of archive files

Postby mtilev » Tue Dec 05, 2017 9:19 am

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: 7135
Joined: Mon Apr 02, 2012 1:11 pm
Contact:

Re: Regular expression for selecting a set of archive files

Postby Daniel » Fri Dec 08, 2017 3:10 pm

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

Postby mtilev » Fri Dec 22, 2017 11:31 am

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

Postby mtilev » Fri Dec 22, 2017 11:42 am

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: 7135
Joined: Mon Apr 02, 2012 1:11 pm
Contact:

Re: Regular expression for selecting a set of archive files

Postby Daniel » Thu Dec 28, 2017 3:55 pm

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

Postby mtilev » Wed Jan 03, 2018 11:01 am

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: 7135
Joined: Mon Apr 02, 2012 1:11 pm
Contact:

Re: Regular expression for selecting a set of archive files

Postby Daniel » Thu Jan 04, 2018 11:30 am

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

Postby mtilev » Thu Jan 11, 2018 5:15 pm

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: 7135
Joined: Mon Apr 02, 2012 1:11 pm
Contact:

Re: Regular expression for selecting a set of archive files

Postby Daniel » Fri Jan 12, 2018 3:09 pm

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”

Who is online

Users browsing this forum: Catalin and 1 guest