although this is my first post here I am using Advanced Installer within our build pipelines for more than 3 Years now, and we are quite happy with it.
In this case we use the Powershell component to fill an existing "template" project with files, components, services, etc. and build an exe installer.
Now we wanted to make some config files "Permanent" and "NeverOrverride" to create them on a fresh install and keep them as they came from the fresh install.
Here is the code block handling this.
Code: Select all
"Set files to never overwrite"
$nonoverwritefiles = $advproj.FilesComponent.Files.Where({ $_.Name -eq "appsettings.json" })
$nonoverwritefiles.Add($advproj.FilesComponent.Files.Where({ $_.Name -eq "config.json" }))
foreach ($file in $nonoverwritefiles) {
"Set NeverOverwrite for $($file.FullPath)"
$file.Component.NeverOverwrite = 1
$file.Component.Permanent = 1
}.json files that do not have a "appsettings.json" or "config.json" file placed beside in the same folder are not affected and deleted/ovewritten as expected.
The log only shows changes made to the correct files
Code: Select all
Set Files to never overwrite
Set NeverOverwrite for APPDIR\ContentServer\appsettings.json
Set NeverOverwrite for APPDIR\Manager\appsettings.json
Set NeverOverwrite for APPDIR\LiveSession\appsettings.json
Set NeverOverwrite for APPDIR\AssetStorage\config.jsonI really don't see why the other files are affected by the changed made to components of other files.
Maybe some of you see the mistake right away, thanks for you help, Eric
FOLLOW US
Get the latest news in Application Packaging