Visual Studio 2022 - problems with extension

Got a problem you cannot solve? Try here.
ZeeOgre
Posts: 3
Joined: Wed Aug 28, 2024 12:36 am

Visual Studio 2022 - problems with extension

Postby ZeeOgre » 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.

JohnGaver
Posts: 115
Joined: Mon Feb 05, 2024 6:15 pm

Re: Visual Studio 2022 - problems with extension

Postby JohnGaver » Fri Aug 30, 2024 1:17 pm

Wow first post, welcome on board!

You shouldn't have to bring in any files manually.

Can you please upload your project so we can check out what's going on?
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm

ZeeOgre
Posts: 3
Joined: Wed Aug 28, 2024 12:36 am

Re: Visual Studio 2022 - problems with extension

Postby ZeeOgre » Sun Sep 01, 2024 12:19 am

Well.. apparently I didn't understand a few things... the single monolithic executable does actually work, but I'd had to make some modifications to the program to allow it to do so.

I had depended on a config file and a database file in folders local to the app.. I'd built them into my distributed output file.

ss_dmm_main.png
ss_dmm_main.png (43.23 KiB) Viewed 1068 times


These did not get picked up as things that needed to be distributed.

But when I added them to the builder, to push them to localappdata, things got much happier.

ZeeOgre
Posts: 3
Joined: Wed Aug 28, 2024 12:36 am

Re: Visual Studio 2022 - problems with extension

Postby ZeeOgre » Sun Sep 01, 2024 1:15 am

Well.. I spoke too soon...

When I build the project using the "standard" build button I go into the settings and have it copy my config.yaml and the app.db file over to the by using COMMONFILES

ss_iafiles.png
ss_iafiles.png (46.54 KiB) Viewed 1065 times

Only the .db file is copying.

I've attached the iaext.zip

Is manually adding all the folders like the docs, database, config files normal?
Well.. let me pause a moment... since i can't create folders there without scripting it in -- i don't see any way to add the folder structure.


With the very large size of the produced single executable, and looking back at the archive folder, it appears that everything there + the "core" of .net core gets added into the executable. Is there an option to exclude the .net core stuff?
Attachments
DevModManager_Any CPU.iaext.zip
(1.36 KiB) Downloaded 48 times


Return to “Technical Support”

Who is online

Users browsing this forum: Google [Bot] and 30 guests