Skip to content

Instantly share code, notes, and snippets.

@gitfvb
Last active July 23, 2019 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gitfvb/625e2feee585442db3d7cb6bcc8f6ed7 to your computer and use it in GitHub Desktop.
Save gitfvb/625e2feee585442db3d7cb6bcc8f6ed7 to your computer and use it in GitHub Desktop.
install a nuget package e.g. Apteco Orbit manually without automatic updates

Another way to install:

Use case

You have a machine that should be able to give users access to Apteco Orbit. But if that machine that runs IIS is not able to connect to external machines in the cloud/internet, than the Apteco Orbit Updater does not work because it needs an external connection. Good news is, you don't need an internet connection to install Orbit. Just follow these instructions:

Prerequisites

  • You have a machine with IIS, which has not access to the internet
  • You have another machine that can download the needed packages and is able to deliver the packages to the IIS server (via network sharing, copy/paste via remote etc)
  • You have the rights on the IIS machine to install packages (mostly admin rights) and to execute PowerShell.

Installation of Orbit

Download of packages on any client

Register-PackageSource -Name "Apteco Orbit" -Location "https://orbit.apteco.com/FastStatsOrbitUpdateServer/nuget" -ProviderName "NuGet"
Find-Package -Source "Apteco Orbit" | Save-Package -Path "C:\Users\Florian\Downloads"
  • Move the *.nupkg-Files to the server that runs IIS

Installation of packages on IIS server

  • Open PowerShell with admin rights
  • Install packages from the subfolder on that server like (replace the first path)
# Login as admin
$cred = Get-Credential

# Go to the download directory of the packages
set-location -Path "C:\Users\Florian\Desktop\20190611\nuget"

# inetpub root
$wwwroot = "C:\inetpub\wwwroot"

# Check if filenames are right
Get-ChildItem -Path ".\" -Filter "*UI*.nupkg" | ForEach {
    $package = Find-Package -Name "FastStatsOrbitUI" -Source $_.DirectoryName
    if ( $_.BaseName -ne $package.PackageFilename) {
        Rename-Item -Path $_.FullName -NewName $package.PackageFilename 
    } 
}
Get-ChildItem -Path ".\" -Filter "*API*.nupkg" | ForEach {
    $package = Find-Package -Name "FastStatsOrbitAPI" -Source $_.DirectoryName
    if ( $_.BaseName -ne $package.PackageFilename) {
        Rename-Item -Path $_.FullName -NewName $package.PackageFilename 
    } 
}

# Find and install packages
$installUI = Find-Package -Name "FastStatsOrbitUI" -Source ".\" | Install-Package -Credential $cred -verbose -Destination $wwwroot
$installAPI = Find-Package -Name "FastStatsOrbitAPI" -Source ".\" | Install-Package -Credential $cred  -verbose -Destination $wwwroot

# installation paths
$installUI.FullPath
$installAPI.FullPath

# next steps

<#

Look at the Folders in the wwwroot for the
    "C:\inetpub\wwwroot\Orbit\web.config"
    "C:\inetpub\wwwroot\OrbitAPI\web.config"
and copy them over to the new created directories

Look at the Folders in the wwwroot for the   
    "C:\inetpub\wwwroot\FastStatsOrbitAPI.1.8.3\OrbitAPIConfigurator.exe"
and open it as administrator. Then use this tool to open 
    "C:\inetpub\wwwroot\OrbitAPI\appsettings.json"
and save it as
    "C:\inetpub\wwwroot\FastStatsOrbitAPI.1.8.3\appsettings.json" 

Look at the Folders in the wwwroot for the   
    "C:\inetpub\wwwroot\Orbit\assets\config.json"
and integrate it via text editor into the file
    "C:\inetpub\wwwroot\FastStatsOrbitUI.1.8.3\assets\config.json"   

After that you can rename the old folders to something else
    "C:\inetpub\wwwroot\Orbit\"
    "C:\inetpub\wwwroot\OrbitAPI\"
and finally rename the installed folders to those folders

Check in the Orbit/index.html file if the base url is set to "/Orbit/" and not "/"

#>
  • Execute SQL scripts in API folder "C:\inetpub\wwwroot\OrbitAPI\UpdateScripts" manually on Orbit Database (normally like "OB_Reisen") e.g. via Microsoft SQL Server Management Studio
  • Follow the instructions in the Orbit manual to setup rewrite rules and deactivation of default content
  • Check in the Orbit/index.html file if the base url is set to "/Orbit/" and not "/"
<#
download nuget cli tool
https://www.nuget.org/downloads
#>
# add orbit source repository for nuget
.\nuget.exe sources add -name "Apteco Orbit" -Source "https://orbit.apteco.com/FastStatsOrbitUpdateServer/nuget"
# OR using a local folder containing the nupkg files
.\nuget.exe sources add -name "Apteco Orbit" -Source "C:\Temp"
# list available sources
.\nuget.exe sources list
# list all available packages in the repository
.\nuget.exe list "Orbit" -Source "Apteco Orbit"
.\nuget.exe list "Orbit" -Source "Apteco Orbit" -AllVersions
# install latest packages
.\nuget.exe install "FastStatsOrbitAPI" -OutputDirectory "C:\inetpub\www"
.\nuget.exe install "FastStatsOrbitUI" -OutputDirectory "C:\inetpub\www"
# OR with the named source
.\nuget.exe install "FastStatsOrbitAPI" -OutputDirectory "C:\TEMP\test" -Source "Apteco Orbit"
# rename manually Folders from e.g. "FastStatsOrbitAPI.1.5.2" to "OrbitAPI"
# rename manually Folders from e.g. "FastStatsOrbitUI.1.5.2" to "Orbit"
# execute SQL scripts in API folder "\UpdateScripts"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment