POS Bundle
To select the components you want to be installed on your POS devices, you create a so-called bundle package. A bundle package is a regular package but has dependencies to the packages (and versions) to be included on your POS, such as the Business Central platform, apps, and a database backup and including your configuration.
When creating a bundle package, have in mind:
- Set explicit version numbers instead of version range.
- I.e. 1.0 instead of >=1.0 <2.0.
- This will give you greater control and prevents unexpected versions from being selected.
- The order of packages in the dependency list can matter.
- Packages are installed in the same sequence as listed.
- Unless it contains a package with dependencies to each other, it will re-order in dependency order for the correct install sequence.
Example
Let's start by creating our first POS setup with vanilla LS Central, which we will extend with your customizations in later steps, such as a database, license, objects, and/or apps.
First, you must have all the packages, you intend to include in your bundle, available on your Update Service server. See Get LS Central to Your Server to download LS Central packages.
Copy the following script to a file named NewBundle.ps1 in a location of your choice:
param( $Server ) $ErrorActionPreference = 'stop' Import-Module UpdateServiceServer # Specify the LS Central version to base your setup on. $LsCentralVersion = '24.0' $Packages = @( @{ Id = 'ls-central-app'; Version = "" } @{ Id = 'map/ls-central-to-bc'; Version = $LsCentralVersion } ) # Get appropriate BC versions for selected LS Central version: $BcPackages = $Packages | Resolve-UssDependencies -Server $Server $BcPlatformVersion = ($BcPackages | Where-Object { $_.id -eq 'bc-server' }).Version $BcAppVersion = ($BcPackages | Where-Object { $_.id -eq 'bc-base-application' }).Version $SetupBundle = @{ Id = "bundle/my-pos" Version = '1.0.0' Name = "My POS" Instance = $true Dependencies = @( @{ Id = 'sql-server-express'; Version = "^-"; 'Optional' = $True } @{ Id = "bc-web-client"; Version = $BcPlatformVersion } @{ Id = 'ls-central-demo-database'; Version = ">=$LsCentralVersion" } @{ Id = "bc-application"; Version = $BcAppVersion } @{ Id = 'ls-central-app-runtime'; Version = $LsCentralVersion } @{ Id = 'ls-central-toolbox-server'; Version = $LsCentralVersion } @{ Id = 'ls-dd-server-addin'; Version = "^ >=3.0 <4.0" } @{ Id = 'ls-hardware-station'; Version = ">=$LsCentralVersion" } ) OutputDir = (Join-Path $env:TEMP 'PackagesOutput') FillParameters = @{ 'bc-server' = @{ AllowSessionCallSuspendWhenWriteTransactionStarted = 'true' } } } New-UssPackage @SetupBundle | Import-UssPackage -Server $Server
or for 14.x or earlier:
$ErrorActionPreference = 'stop' Import-Module UpdateServiceServer # Specify the LS Central version to base your setup on. $LsCentralVersion = '14.0' # Get matching Business Central version: $BcVersion = (Resolve-UssDependencies -Id 'ls-central-objects' -Version "$LsCentralVersion" | Where-Object { $_.id -eq 'bc-server' }).Version $SetupBundle = @{ Id = "bundle/my-pos" Version = '1.0.0' Name = "My POS" Instance = $true Dependencies = @( @{ Id = 'sql-server-express'; Version = "^-"; Optional = $True } @{ Id = 'ls-central-demo-database'; Version = ">=$LsCentralVersion" } @{ Id = 'ls-central-toolbox-server'; Version = ">=$LsCentralVersion" } @{ Id = 'ls-central-toolbox-client'; Version = ">=$LsCentralVersion" } @{ Id = 'ls-central-web-pos-addin'; Version = ">=$LsCentralVersion" } @{ Id = 'ls-central-objects'; Version = ">=$LsCentralVersion" } @{ Id = 'ls-dd-client-addin'; Version = "^ >=3.0 <4.0" } @{ Id = 'ls-dd-server-addin'; Version = "^ >=3.0 <4.0" } @{ Id = "bc-web-client"; Version = "=$BcVersion" } @{ Id = 'ls-hardware-station'; Version = ">=$LsCentralVersion" } @{ Id = 'ls-central-start'; Version = "" } @{ Id = 'ls-central-opos'; Version = ">=$LsCentralVersion" } @{ Id = 'ls-central-dual-display'; Version = ">=$LsCentralVersion" } ) OutputDir = (Join-Path $env:TEMP 'PackagesOutput') FillParameters = @{ 'bc-server' = @{ AllowSessionCallSuspendWhenWriteTransactionStarted = 'true' } } } New-UssPackage @SetupBundle | Import-UssPackage
Few things you should notice:
- No commands are implemented nor any files are included in this package, it only lists the LS Central packages as dependencies, later we will include your customizations in this list.
- In FillParameters we set an argument for the bc-server package, called AllowSessionCallSuspendWhenWriteTransactionStarted. So every time we will install the bundle/my-pos package, this argument will be used when configuring the service tier.
You can specify a different version of LS Central by updating the
$LsCentralVersion
's value to the version you prefer.Execute the script to create the package and import it to your server.
- Now you should have a package called bundle/my-pos on your Update Service server.
Install the bundle package, either with an installer or PowerShell (
Install-UscPackage
):
Import-Module UpdateService
Install-UscPackage -Id 'bundle/my-pos' -InstanceName 'POS'
Add Customizations to the Bundle
Before you can include your customizations in your bundle, you must create packages for them, see the following guides:
When you've created the packages and have them available on your server, you can add them to your bundle. Here is an example how they can be included:
$ErrorActionPreference = 'stop'
Import-Module UpdateServiceServer
# Specify the LS Central version to base your setup on.
$LsCentralVersion = '16.0'
# Get appropriate BC versions for selected LS Central version:
$BcPackages = Resolve-UssDependencies -Id 'map/ls-central-to-bc' -Version "$LsCentralVersion"
$BcPlatformVersion = ($BcPackages | Where-Object { $_.id -eq 'bc-server' }).Version
$BcAppVersion = ($BcPackages | Where-Object { $_.id -eq 'bc-base-application' }).Version
$SetupBundle = @{
Id = "bundle/my-pos"
Version = '1.0.0'
Name = "My POS"
Instance = $true
Dependencies = @(
@{ Id = 'sql-server-express'; Version = "^-"; 'Optional' = $True }
@{ Id = "bc-web-client"; Version = $BcPlatformVersion }
#@{ Id = 'ls-central-demo-database'; Version = ">=$LsCentralVersion" }
@{ Id = 'my-database'; Version = "1.0.0" }
@{ Id = "bc-system-symbols"; Version = $BcPlatformVersion }
@{ Id = "bc-system-application-runtime"; Version = $BcAppVersion }
@{ Id = 'ls-central-app-runtime'; Version = $LsCentralVersion }
@{ Id = 'ls-central-toolbox-server'; Version = $LsCentralVersion }
@{ Id = 'ls-dd-server-addin'; Version = "^ >=3.0 <4.0" }
@{ Id = 'my-license'; Version = '1.0.0' }
@{ Id = 'my-app'; Version = '1.0.0' }
@{ Id = 'my-dotnet-server-addin'; Version = '1.0.0' }
@{ Id = 'ls-hardware-station'; Version = ">=$LsCentralVersion" }
)
OutputDir = (Join-Path $env:TEMP 'PackagesOutput')
FillParameters = @{
'bc-server' = @{
AllowSessionCallSuspendWhenWriteTransactionStarted = 'true'
}
}
}
New-UssPackage @SetupBundle | Import-UssPackage
or for 14.x or earlier:
$ErrorActionPreference = 'stop'
Import-Module UpdateServiceServer
# Specify the LS Central version to base your setup on.
$LsCentralVersion = '14.0'
# Get matching Business Central version:
$BcVersion = (Resolve-UssDependencies -Id 'ls-central-objects' -Version "$LsCentralVersion" | Where-Object { $_.id -eq 'bc-server' }).Version
$SetupBundle = @{
Id = "bundle/my-pos"
Version = '1.0.0'
Name = "My POS"
Instance = $true
Dependencies = @(
@{ Id = 'sql-server-express'; Version = "^-"; Optional = $True }
#@{ Id = 'ls-central-demo-database'; Version = ">=$LsCentralVersion" }
@{ Id = 'my-database'; Version = "1.0.0" }
@{ Id = 'ls-central-toolbox-server'; Version = ">=$LsCentralVersion" }
@{ Id = 'ls-central-toolbox-client'; Version = ">=$LsCentralVersion" }
@{ Id = 'ls-central-web-pos-addin'; Version = ">=$LsCentralVersion" }
@{ Id = 'ls-central-objects'; Version = ">=$LsCentralVersion" }
@{ Id = 'ls-dd-client-addin'; Version = "^ >=3.0 <4.0" }
@{ Id = 'ls-dd-server-addin'; Version = "^ >=3.0 <4.0" }
@{ Id = 'my-license'; Version = '1.0.0' }
@{ Id = 'my-app'; Version = '1.0.0' }
@{ Id = 'my-dotnet-server-addin'; Version = '1.0.0' }
@{ Id = "bc-web-client"; Version = "=$BcVersion" }
@{ Id = 'ls-hardware-station'; Version = ">=$LsCentralVersion" }
@{ Id = 'ls-central-start'; Version = "" }
@{ Id = 'ls-central-opos'; Version = ">=$LsCentralVersion" }
@{ Id = 'ls-central-dual-display'; Version = ">=$LsCentralVersion" }
)
OutputDir = (Join-Path $env:TEMP 'PackagesOutput')
FillParameters = @{
'bc-server' = @{
AllowSessionCallSuspendWhenWriteTransactionStarted = 'true'
}
}
}
New-UssPackage @SetupBundle | Import-UssPackage
Few details:
- There can only be one database package in a bundle, you must remove the ls-central-demo-database from the dependency list when adding your package my-database.
- You can add multiple app and DotNet add-in packages.
- If you are using objects (fobs) package, we recommend to only have one such package with all your objects.