Visual Studio 2022 - problems with extension
Posted: Wed Aug 28, 2024 12:50 am
Good Morning All!
I've been trying to build my first InstallAware package, and I'm not having too much luck.
I tried installing, and it seems to work ok.
I start with the blue gear, and it builds out he framework .iaext.prjconf file.
I then go to settings, and set all my parameters, but my files are not coming in from my release folder automatically.
So I built a ps1 script to bring all of them in.
param (
[string]$projectFilePath = "../InstallAware/DevModManager_Any CPU.iaext.prjconf",
[string]$sourceDir = "../bin/Release/net8.0-windows"
)
try {
# Load the XML file
[xml]$xml = Get-Content $projectFilePath
# Find the <files> node
$filesNode = $xml.iasettings.files
# Clear existing file details
$filesNode.RemoveAll()
# Function to add file details to the XML
function Add-FileDetails {
param (
[string]$filePath,
[string]$relativePath
)
$fileDetails = $xml.CreateElement("filedetails")
$fileDetails.SetAttribute("filename", $filePath)
$fileDetails.SetAttribute("targetlocation", "\$TARGETDIR$\$relativePath")
$fileDetails.SetAttribute("type", "0")
$fileDetails.SetAttribute("generatenativeimage", "0")
$fileDetails.SetAttribute("registerassembly", "0")
$fileDetails.SetAttribute("runinstallerclass", "0")
$fileDetails.SetAttribute("createshortcut", "0")
$fileDetails.SetAttribute("runprogram", "0")
$fileDetails.SetAttribute("installfilecommand", "1")
$fileDetails.SetAttribute("VsProjectOutputfile", "0")
$filesNode.AppendChild($fileDetails)
}
# Recursively add files to the XML
Get-ChildItem -Path $sourceDir -Recurse -File | ForEach-Object {
$relativePath = $_.FullName.Substring((Get-Item $sourceDir).FullName.Length + 1)
Add-FileDetails -filePath $_.FullName -relativePath $relativePath
}
# Save the updated XML back to the file
$xml.Save($projectFilePath)
Write-Output "Files added successfully to the project configuration."
} catch {
Write-Error "An error occurred: $_"
exit 1
}
When I reopen settings, it wipes out all the files i've added, so I need to re-run the script to re-add all of them
That finally got the installaware to compile, and generate an msi, but then it told me "could not access netowrk location \$\filename.deps.json
The only file by default shows as filename.exe, and it points to the filename.dll from the release folder.
If I build just that, I get a single huge executable - which definitely won't work, because I have folder path/file dependencies.
Not sure what I might be doing wrong, or if there's actually a problem in the current release
Visual Studio 2022 17.11.1
InstallAware was downloaded and installed today, so about as fresh as it gets.
I've been trying to build my first InstallAware package, and I'm not having too much luck.
I tried installing, and it seems to work ok.
I start with the blue gear, and it builds out he framework .iaext.prjconf file.
I then go to settings, and set all my parameters, but my files are not coming in from my release folder automatically.
So I built a ps1 script to bring all of them in.
param (
[string]$projectFilePath = "../InstallAware/DevModManager_Any CPU.iaext.prjconf",
[string]$sourceDir = "../bin/Release/net8.0-windows"
)
try {
# Load the XML file
[xml]$xml = Get-Content $projectFilePath
# Find the <files> node
$filesNode = $xml.iasettings.files
# Clear existing file details
$filesNode.RemoveAll()
# Function to add file details to the XML
function Add-FileDetails {
param (
[string]$filePath,
[string]$relativePath
)
$fileDetails = $xml.CreateElement("filedetails")
$fileDetails.SetAttribute("filename", $filePath)
$fileDetails.SetAttribute("targetlocation", "\$TARGETDIR$\$relativePath")
$fileDetails.SetAttribute("type", "0")
$fileDetails.SetAttribute("generatenativeimage", "0")
$fileDetails.SetAttribute("registerassembly", "0")
$fileDetails.SetAttribute("runinstallerclass", "0")
$fileDetails.SetAttribute("createshortcut", "0")
$fileDetails.SetAttribute("runprogram", "0")
$fileDetails.SetAttribute("installfilecommand", "1")
$fileDetails.SetAttribute("VsProjectOutputfile", "0")
$filesNode.AppendChild($fileDetails)
}
# Recursively add files to the XML
Get-ChildItem -Path $sourceDir -Recurse -File | ForEach-Object {
$relativePath = $_.FullName.Substring((Get-Item $sourceDir).FullName.Length + 1)
Add-FileDetails -filePath $_.FullName -relativePath $relativePath
}
# Save the updated XML back to the file
$xml.Save($projectFilePath)
Write-Output "Files added successfully to the project configuration."
} catch {
Write-Error "An error occurred: $_"
exit 1
}
When I reopen settings, it wipes out all the files i've added, so I need to re-run the script to re-add all of them
That finally got the installaware to compile, and generate an msi, but then it told me "could not access netowrk location \$\filename.deps.json
The only file by default shows as filename.exe, and it points to the filename.dll from the release folder.
If I build just that, I get a single huge executable - which definitely won't work, because I have folder path/file dependencies.
Not sure what I might be doing wrong, or if there's actually a problem in the current release
Visual Studio 2022 17.11.1
InstallAware was downloaded and installed today, so about as fresh as it gets.