2016-06-11 7 views
0

私が持っているもの:バグ、デスクトップアプリケーション(Windowsアプリケーション(exe))、企業ネットワークで共有されるフォルダ(アプリケーションビルドが保持されているもの)バグでデスクトップアプリケーションのインストールを自動化する可能性

私がする必要がどのような:

  1. ベイグラントを(今のところ、私はそれを手動で行う)のインストール - 完成。
  2. Windows 8.1とWindows 10のボックスをインストールします(これは手動で行います)。
  3. 社内ネットワークで共有されているフォルダ(そのフォルダ内に複数のファイルがあります)から最新のビルド(.exeファイル)を取得し、それを不愉快なマシン(Win 8など)に置き、静かにインストールします。

すべてのプロセスは可能な限り自動化する必要があります。

しかし、私はVagrantマシンとコピー/インストールアプリケーションを組み合わせることはできません。私はPowerShellを掘り起こす - 運がない...私はサイレントインストール用のPowerShellスクリプトを持っているが、多分、これらのすべてのアクション(PowerShellなど)のためのスクリプトを作成する能力があるだろうか?私はChocolateyを使うことができると知っていますが、私はステップバイステップで行うことができるスクリプトが必要です。

+0

FileZilla、Hyper-V、VMWareなどを使って、Windowsのイメージを展開することは可能でしょうか? –

+0

もちろん、どうしてですか?私は最初からすべてを構築しているので、すべての可能な解決策を試してみませんか? VMWareを除きます。 Vagrant + PowerShellを選んだのは、PSで記述されたスクリプト(サイレントインストールオプション付き)を持っているので、Windows仮想マシンとPowerShellを簡単に作成できるからです。基本的には、Windows(8.1および10)環境でインストールプロセスをテストする必要があります。 –

答えて

0

私は(私は必要なフォルダを作成し、スクリプトがベイグラント、VirtualBoxのをインストールし、私は必要なファイルをコピー)チョコレートのよう指令に基づいており、非常に簡単なスクリプトを作成することによって、問題を解決:

# Set PowerShell policy to Unrestricted 

Set-ExecutionPolicy Unrestricted -Force 

# Install Chocolatey 
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex 

# Turn off confirmation in Chocolatey 
chocolatey feature enable -n=allowGlobalConfirmation 

# Install Vagrant 
choco install vagrant 

# Install VirutalBox 
choco install virtualbox 

# Create folder where Vagrant box will be placed 
New-Item -ItemType directory -Path "D:\VagrantBoxes\Win8" 

# Create folder where release will be placed 
New-Item -ItemType directory -Path "D:\Release" 

# Map network drive (release folder) 
New-PSDrive –Name “B” –PSProvider FileSystem –Root 
“\\r\P\A\OS\D B\R 2\x64” –Persist 

# Map network drive (vagrant boxes folder) 

New-PSDrive –Name “B” –PSProvider FileSystem –Root 
“\\r\P\A\A\V M\V m” –Persist 

# Copy Vagrant box from network folder 
Copy-Item -Path 
"B:\windows_81x64-enterprise_virtualbox_15.07.17.box" -Destination "D:\VagrantBoxes\Win8" 

# Copy newest build from network folder to remote machine 

Get-ChildItem "B:\" -Filter '*.exe' | Where Name -NotMatch '.*NoDB\.exe$' | Sort LastWriteTime -Descending | Select -First 1 | Copy-Item -Destination 'D:\' 

# Navigate to folder where Vagrant file will be placed 

CD "D:\VagrantBoxes\Win8" 

# Mount Windows box 

vagrant init windows_81x64-enterprise_virtualbox_15.07.17.box 

# Run Vagrant 

vagrant up 

2番目のスクリプトがためのものですWindowsマシン内のソフトウェアのインストールプロセス(私はここでこのコードを投稿することはできません)。

関連する問題