3

I would like to ask for help.

What I have: Vagrant, desktop application which I need to install, folder which is shared in corporate network.

What I need to do:

  1. Install Vagrant (for now I do it manually) - completed;
  2. Install Windows 8.1 and Windows 10 boxes (for now I do it manually) - completed;
  3. Get the newest build of application (.exe file) from folder which is shared in corporate network (there are several files in that folder), put it in Vagrant machine (Win 8 for example) and silently install on in.

All steps should be automated as much as possible.

But I can't combine Vagrant and copy/install application to Vagrant machine. I dig in PowerShell - but no luck...

Maybe you can help. Thanks in advance.

4
  • You may get better results in Stack Overflow (for PowerShell scripts) or Server Fault for this question - particularly since there's nothing specific to testing/SQA in the question.
    – Kate Paulk
    Commented Jun 10, 2016 at 18:50
  • Thanks for advice, but I guess it's definitely about testing and SQA - because I need to install application in Vagrant automatically - run a script and have the result.
    – Mikhail R
    Commented Jun 11, 2016 at 18:55
  • 1
    That may be so - but the process of building the scripts isn't necessarily SQA/Testing related - and there tends to be more programming knowledge in the forums I suggested.
    – Kate Paulk
    Commented Jun 13, 2016 at 11:35
  • Kate, like you said - solution is found in Stack Overflow (programming section). So yeah, you were wright :)
    – Mikhail R
    Commented Jun 16, 2016 at 9:15

3 Answers 3

0

I would do steps 1 and 2 and then try to save the state of the machine (for reuse).

For example use vagrant snapshots - https://www.vagrantup.com/docs/cli/snapshot.html

Then the only task is to copy in the latest code and run the install for it. Those steps can usually be automated too with a script.

1
  • Thanks. I have saved Vagrant boxes and I know how to install application silently with PowerShell script. But the problem is - how can I put this script in Vagrant machine? How to make the script as part of Vagrant box?
    – Mikhail R
    Commented Jun 11, 2016 at 18:58
0

For getting the installed to the vagrant box, is the vagrant box able to access the internal file share? An option might be to scp the file from your script.

Once you have the file on the Vagrant box, to install it silently you could just call the executable from a script. For example, if you are scripting in python you could do something like os.system("installer.exe") and that would run the exe. Some installers support silent installation with a "-s" option, so using the example above, just update to os.system("installer.exe -s"). Keep in mind your installer might not support silent installation mode, or might use a different flag to accomplish silent installation. Consult your dev team to see how you can silently install.

1
  • I use PowerShell but I guess I can use Python as well. But the main problem is about combine installation script with Vagrant box? And it is possible to make one script for 3 actions - install Vagrant, create Windows box, run script (I have PowerShell script) which will install application in silent mode (I have some keys for it (again those keys are for PowerShell)?
    – Mikhail R
    Commented Jun 11, 2016 at 19:02
0
  • Start with a vagrant box for each base OS,
  • set up a vagrantfile and winrm file so as to
  • allow your file provisioning to take place which will copy the installer to the box
  • the installer can then be run with a shell provisioner - this is where you run the installer in silent mode.

Note that the provisioning can all be set up within the vagrantfile.

From then on you just call vagrant up --provision in the project directory when there has been a change of the executable that you need to test.

1
  • Steve, first of all I would like to say thank you. Your solution is very close to what I want. For now I decided to use simple PowerShell script which is based on Chocolatey cmdlets + PowerShell cmdlets. I used Chocolatey to install Vagrant and VirtualBox and PowerShell to copy files and etc. It did the trick but in future I would like to improve all the process, because I am completely new in software automation.
    – Mikhail R
    Commented Jun 16, 2016 at 9:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.