Skip to content

Commit

Permalink
Merge pull request #4 from advantys/fix-install-script
Browse files Browse the repository at this point in the history
fix: install script correction
  • Loading branch information
QuentinPom authored Dec 10, 2018
2 parents cb91b45 + f468604 commit 21bc9d0
Showing 1 changed file with 41 additions and 40 deletions.
81 changes: 41 additions & 40 deletions src/Install/Install.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,44 @@
if (Test-Path "$PSScriptRoot\config.json"){
function LaunchMsGraphDownload
{
$url = "https://dist.nuget.org/win-x86-commandline/v4.8.1/nuget.exe"
$output = "$PSScriptRoot\nuget.exe"
$workingFolder = "$PSScriptRoot\workingFolder"
$webPath = $settings.WebAppPath
$servicePath = $settings.ServicesPath


Invoke-WebRequest -Uri $url -OutFile $output


#Get Microsoft-Graph Package
$command = "$PSScriptRoot\nuget.exe install Microsoft.Graph -Version 1.10.0 -OutputDirectory $workingFolder"

iex $command

Copy-Item "$workingFolder\Microsoft.Graph.1.10.0\lib\net45\Microsoft.Graph.dll" -Destination "$webPath\bin"
Copy-Item "$workingFolder\Microsoft.Graph.1.10.0\lib\net45\Microsoft.Graph.dll" -Destination "$webPath\ws\bin"
Copy-Item "$workingFolder\Microsoft.Graph.1.10.0\lib\net45\Microsoft.Graph.dll" -Destination "$servicePath\bin"

Copy-Item "$workingFolder\Microsoft.Graph.Core.1.10.0\lib\net45\Microsoft.Graph.Core.dll" -Destination "$webPath\bin"
Copy-Item "$workingFolder\Microsoft.Graph.Core.1.10.0\lib\net45\Microsoft.Graph.Core.dll" -Destination "$webPath\ws\bin"
Copy-Item "$workingFolder\Microsoft.Graph.Core.1.10.0\lib\net45\Microsoft.Graph.Core.dll" -Destination "$servicePath\bin"


#Get Microsoft-Graph-identity Package
$command = "$PSScriptRoot\nuget.exe install Microsoft.Identity.Client -Version 2.0.0-preview -OutputDirectory $workingFolder"

iex $command
Copy-Item "$workingFolder\Microsoft.Identity.Client.2.0.0-preview\lib\net45\Microsoft.Identity.Client.dll" -Destination "$webPath\bin"
Copy-Item "$workingFolder\Microsoft.Identity.Client.2.0.0-preview\lib\net45\Microsoft.Identity.Client.dll" -Destination "$webPath\ws\bin"
Copy-Item "$workingFolder\Microsoft.Identity.Client.2.0.0-preview\lib\net45\Microsoft.Identity.Client.dll" -Destination "$servicePath\bin"

Remove-Item $output
Remove-Item $workingFolder -Force -Recurse
}



if (Test-Path "$PSScriptRoot\config.json"){
$settings = (Get-Content "$PSScriptRoot\config.json" -Raw) | ConvertFrom-Json
}
else{
Expand Down Expand Up @@ -30,8 +70,6 @@ if(Test-Path $settings.WebAppPath)
Write-Host $message
LaunchMsGraphDownload

$webPath = $settings.WebAppPath
$servicePath = $settings.ServicesPath
#Copy WorkflowGenMsGraph dll
Copy-Item "$PSScriptRoot\Advantys.Workflow.Applications.MicrosoftGraph.dll" -Destination "$webPath\bin"
Copy-Item "$PSScriptRoot\Advantys.Workflow.Applications.MicrosoftGraph.dll" -Destination "$webPath\ws\bin"
Expand All @@ -51,40 +89,3 @@ else
exit 1
}

function LaunchMsGraphDownload
{
$url = "https://dist.nuget.org/win-x86-commandline/v4.8.1/nuget.exe"
$output = "$PSScriptRoot\nuget.exe"
$workingFolder = "$PSScriptRoot\workingFolder"
$webPath = $settings.WebAppPath
$servicePath = $settings.ServicesPath


Invoke-WebRequest -Uri $url -OutFile $output


#Get Microsoft-Graph Package
$command = "$PSScriptRoot\nuget.exe install Microsoft.Graph -Version 1.10.0 -OutputDirectory $workingFolder"

iex $command

Copy-Item "$workingFolder\Microsoft.Graph.1.10.0\lib\net45\Microsoft.Graph.dll" -Destination "$webPath\bin"
Copy-Item "$workingFolder\Microsoft.Graph.1.10.0\lib\net45\Microsoft.Graph.dll" -Destination "$webPath\ws\bin"
Copy-Item "$workingFolder\Microsoft.Graph.1.10.0\lib\net45\Microsoft.Graph.dll" -Destination "$servicePath\bin"

Copy-Item "$workingFolder\Microsoft.Graph.Core.1.10.0\lib\net45\Microsoft.Graph.Core.dll" -Destination "$webPath\bin"
Copy-Item "$workingFolder\Microsoft.Graph.Core.1.10.0\lib\net45\Microsoft.Graph.Core.dll" -Destination "$webPath\ws\bin"
Copy-Item "$workingFolder\Microsoft.Graph.Core.1.10.0\lib\net45\Microsoft.Graph.Core.dll" -Destination "$servicePath\bin"


#Get Microsoft-Graph-identity Package
$command = "$PSScriptRoot\nuget.exe install Microsoft.Identity.Client -Version 2.0.0-preview -OutputDirectory $workingFolder"

iex $command
Copy-Item "$workingFolder\Microsoft.Identity.Client.2.0.0-preview\lib\net45\Microsoft.Identity.Client.dll" -Destination "$webPath\bin"
Copy-Item "$workingFolder\Microsoft.Identity.Client.2.0.0-preview\lib\net45\Microsoft.Identity.Client.dll" -Destination "$webPath\ws\bin"
Copy-Item "$workingFolder\Microsoft.Identity.Client.2.0.0-preview\lib\net45\Microsoft.Identity.Client.dll" -Destination "$servicePath\bin"

Remove-Item $output
Remove-Item $workingFolder -Force -Recurse
}

0 comments on commit 21bc9d0

Please sign in to comment.