Custom arguments

Apr 4, 2014 at 1:47 AM
Is there a way to pass custom arguments to a BoxStarter script?

I'm wanting to install a component that requires login details (eg. the DevExpress components as Robert describes in http://blog.zerosharp.com/provisioning-a-new-development-machine-with-boxstarter/)

However I'd like this to be per-user. eg. Each user runs BoxStarter and I can prompt them to enter their DevExpress email and password, and then BoxStarter passes this through to the script somehow.

-dave
May 8, 2014 at 3:14 AM
From what I can tell this isn't supported via the use of command line parameters, however you could solicit user input from within your BoxStarter script using Read-Host.
Marked as answer by flcdrg on 5/7/2014 at 11:17 PM
Editor
May 8, 2014 at 6:59 AM
Hello flcdrg,

If I have understood correctly then I think that joe_om is onto the right idea. During the execution of the Boxstarter package you could essentially prompt the user to provide the email address and password that they would like to use, and then string.Format them into the parameters that are passed into the installer. Bear in mind though, this will halt the execution of the Boxstarter installation until the prompt for input is passed, so the concept of an unattended installation won't work.

You might want to think about putting this information into a text file, that could be read by the Boxstarter package instead, that way, if there are multiple executions of the package (due to system reboots), you won't be prompted each time. Obviously, care needs to be taken to encrypt the password when using this approach.

Gary
Marked as answer by flcdrg on 5/7/2014 at 11:17 PM
May 8, 2014 at 7:17 AM
Hi Gary & Joe,

I think the Read-Host approach will do the job.

thanks,
-dave
May 8, 2014 at 7:30 AM
Good point Gary..

I have just started to play with some of these ideas and am looking at using Windows' DPAPI to encrypt anything sensitive, and maybe Isolated Storage for any temporary files.

If you need a sample, BoxStarter itself stores credentials to provide autologon after reboot. It does this using LsaStorePrivateData. This seems to have been superseded by DPAPI, but it's a good sample anyway.

Check out https://boxstarter.codeplex.com/SourceControl/latest#Boxstarter.Bootstrapper/Set-SecureAutoLogon.ps1
May 11, 2014 at 10:20 PM
I too am in need of passing data into a boxstarter package. Chocolatey Install command supports an argument PackageParameters which accepts a ';' seperated string of name=value pairs. Wishing that Install-BoxstarterPackage be enhanced to support -PackageParameters and pass it's value through to the package's chocolateyInstall.ps1 script.

Thanks for a great package!
Coordinator
Jun 22, 2014 at 7:29 AM
created an issue for this and tracking at https://boxstarter.codeplex.com/workitem/79. I agree this would be a useful feature.