Skip to content

Commit

Permalink
Merge pull request #2841 from freddydk/master
Browse files Browse the repository at this point in the history
4.0.9
  • Loading branch information
freddydk authored Jan 7, 2023
2 parents d909f75 + 209a580 commit 5aefb02
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 14 deletions.
14 changes: 13 additions & 1 deletion AppHandling/Compile-AppInNavContainer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,17 @@ try {
if ("$appName" -eq "") {
$appName = "$($appJsonObject.Publisher)_$($appJsonObject.Name)_$($appJsonObject.Version).app".Split([System.IO.Path]::GetInvalidFileNameChars()) -join ''
}

if ([bool]($appJsonObject.PSobject.Properties.name -eq "id")) {
AddTelemetryProperty -telemetryScope $telemetryScope -key "id" -value $appJsonObject.id
}
elseif ([bool]($appJsonObject.PSobject.Properties.name -eq "appid")) {
AddTelemetryProperty -telemetryScope $telemetryScope -key "id" -value $appJsonObject.appid
}
AddTelemetryProperty -telemetryScope $telemetryScope -key "publisher" -value $appJsonObject.Publisher
AddTelemetryProperty -telemetryScope $telemetryScope -key "name" -value $appJsonObject.Name
AddTelemetryProperty -telemetryScope $telemetryScope -key "version" -value $appJsonObject.Version
AddTelemetryProperty -telemetryScope $telemetryScope -key "appname" -value $appName

Write-Host "Using Symbols Folder: $appSymbolsFolder"
if (!(Test-Path -Path $appSymbolsFolder -PathType Container)) {
New-Item -Path $appSymbolsFolder -ItemType Directory | Out-Null
Expand Down Expand Up @@ -263,11 +273,13 @@ try {

if (([bool]($appJsonObject.PSobject.Properties.name -eq "application")) -and $appJsonObject.application)
{
AddTelemetryProperty -telemetryScope $telemetryScope -key "application" -value $appJsonObject.application
$dependencies += @{"publisher" = "Microsoft"; "name" = "Application"; "version" = $appJsonObject.application }
}

if (([bool]($appJsonObject.PSobject.Properties.name -eq "platform")) -and $appJsonObject.platform)
{
AddTelemetryProperty -telemetryScope $telemetryScope -key "platform" -value $appJsonObject.platform
$dependencies += @{"publisher" = "Microsoft"; "name" = "System"; "version" = $appJsonObject.platform }
}

Expand Down
4 changes: 2 additions & 2 deletions BC.HelperFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ if (!(Test-Path $configHelperFolder)) {
New-Item -Path $configHelperFolder -ItemType Container -Force | Out-Null
if ($isWindows -and !$isAdministrator) {
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule($myUsername,'FullControl', 3, 'InheritOnly', 'Allow')
$acl = [System.IO.Directory]::GetAccessControl($configHelperFolder)
$acl = Get-Acl -Path $configHelperFolder
$acl.AddAccessRule($rule)
[System.IO.Directory]::SetAccessControl($configHelperFolder,$acl)
Set-Acl -Path $configHelperFolder -AclObject $acl | Out-Null
}
}

Expand Down
8 changes: 4 additions & 4 deletions BcContainerHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ if (!(Test-Path -Path $extensionsFolder -PathType Container)) {
}
New-Item -Path $extensionsFolder -ItemType Container -Force | Out-Null

if ($isWindows -and !$isPsCore -and !$isAdministrator) {
if ($isWindows -and !$isAdministrator) {
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule($myUsername,'FullControl', 3, 'InheritOnly', 'Allow')
$acl = [System.IO.Directory]::GetAccessControl($bcContainerHelperConfig.hostHelperFolder)
$acl = Get-Acl -Path $bcContainerHelperConfig.hostHelperFolder
$acl.AddAccessRule($rule)
[System.IO.Directory]::SetAccessControl($bcContainerHelperConfig.hostHelperFolder,$acl)
Set-Acl -Path $bcContainerHelperConfig.hostHelperFolder -AclObject $acl | Out-Null
}
}

if ($isWindows -and !$isPsCore) {
if ($isWindows) {
. (Join-Path $PSScriptRoot "Check-BcContainerHelperPermissions.ps1")
if (!$silent) {
Check-BcContainerHelperPermissions -Silent
Expand Down
10 changes: 4 additions & 6 deletions Check-BcContainerHelperPermissions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ function Check-BcContainerHelperPermissions {
Write-Host "Checking permissions to $($bcContainerHelperConfig.hostHelperFolder)"
}
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule($myUsername,'FullControl', 3, 'InheritOnly', 'Allow')
$access = [System.IO.Directory]::GetAccessControl($bcContainerHelperConfig.hostHelperFolder).Access |
Where-Object { $_.IdentityReference -eq $rule.IdentityReference -and $_.FileSystemRights -eq $rule.FileSystemRights -and $_.AccessControlType -eq $rule.AccessControlType -and $_.InheritanceFlags -eq $rule.InheritanceFlags }

$acl = Get-Acl -Path $bcContainerHelperConfig.hostHelperFolder
$access = $acl.Access | Where-Object { $_.IdentityReference -eq $rule.IdentityReference -and $_.FileSystemRights -eq $rule.FileSystemRights -and $_.AccessControlType -eq $rule.AccessControlType -and $_.InheritanceFlags -eq $rule.InheritanceFlags }
if ($access) {
if (!$silent) {
Write-Host -ForegroundColor Green "$myUsername has the right permissions to $($bcContainerHelperConfig.hostHelperFolder)"
Expand Down Expand Up @@ -83,9 +82,8 @@ function Check-BcContainerHelperPermissions {
Write-Host "Checking permissions to $hostsFile"
}
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule($myUsername,'Modify', 'Allow')
$access = [System.IO.Directory]::GetAccessControl($hostsFile).Access |
Where-Object { $_.IdentityReference -eq $rule.IdentityReference -and $_.FileSystemRights -eq $rule.FileSystemRights -and $_.AccessControlType -eq $rule.AccessControlType }

$acl = Get-Acl -Path $hostsFile
$access = $acl.Access | Where-Object { $_.IdentityReference -eq $rule.IdentityReference -and $_.FileSystemRights -eq $rule.FileSystemRights -and $_.AccessControlType -eq $rule.AccessControlType }
if ($access) {
if (!$silent) {
Write-Host -ForegroundColor Green "$myUsername has the right permissions to $hostsFile"
Expand Down
3 changes: 3 additions & 0 deletions NuGet/New-BcNuGetPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ Function New-BcNuGetPackage {
$XmlObjectWriter.Flush()
$XmlObjectWriter.Close()

Write-Host "NUSPEC file:"
Get-Content -path $nuspecFileName -Encoding UTF8 | Out-Host

$nuPkgFileName = "$($packageId)-$($packageVersion).nupkg"
$nupkgFile = Join-Path ([System.IO.Path]::GetTempPath()) $nuPkgFileName
if (Test-Path $nuPkgFile -PathType Leaf) {
Expand Down
5 changes: 5 additions & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
4.0.9
Experimental support for PowerShell 7, please report any issues on https://github.com/microsoft/navcontainerhelper/issues.
Experimantal support for running BcContainerHelper on Linux (only non-container stuff), please report any issues on https://github.com/microsoft/navcontainerhelper/issues.
Adding additional properties to telemetry. Set MicrosoftTelemetryConnectionString to an empty string in settings to opt-out.

4.0.8
Add parameter 'features' to Run-AlPipeline which allows for setting the compiler features
Add SchemaSyncMode to Publish-PerTenantExtensionApps
Expand Down
2 changes: 1 addition & 1 deletion Version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.8-dev
4.0.9-dev

0 comments on commit 5aefb02

Please sign in to comment.