Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Could not export DLSS dll #246

Open
sodgaard opened this issue Nov 24, 2024 · 23 comments
Open

[BUG] Could not export DLSS dll #246

sodgaard opened this issue Nov 24, 2024 · 23 comments
Labels
bug Something isn't working

Comments

@sodgaard
Copy link

sodgaard commented Nov 24, 2024

Unable to unpack newly downloaded DLSS versions.
Program version 1.0.5

A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Library'
  2. After download eg 3.8.10
  3. Click on 'click Export'
  4. See error
  5. Error: Could not export DLSS dll"

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
From the log file:
2024-11-24 18:17:17.066 +01:00 [ERR] FileVersionInfoExtensions.cs:24 GetMD5Hash - C:\Program Files\WindowsApps\Microsoft.Limitless_1.1.9.0_x64__8wekyb3d8bbwe\nvngx_dlss.dll, The process cannot access the file 'C:\Program Files\WindowsApps\Microsoft.Limitless_1.1.9.0_x64__8wekyb3d8bbwe\nvngx_dlss.dll' because it is being used by another process.
2024-11-24 18:51:46.973 +01:00 [ERR] LibraryPage.xaml.cs:726 ExportRecordAsync -
2024-11-24 18:51:55.130 +01:00 [ERR] LocalRecord.cs:177 Delete - Could not find a part of the path 'C:\WINDOWS\system32\StoredData\dlss_zip\3.8.10.0_AED94E7029846C356882DB166B824F5E.zip'.
2024-11-24 18:52:10.204 +01:00 [ERR] LibraryPage.xaml.cs:273 ExportAllAsync -
2024-11-24 18:54:04.327 +01:00 [ERR] LibraryPage.xaml.cs:726 ExportRecordAsync -
2024-11-24 18:54:58.937 +01:00 [ERR] LibraryPage.xaml.cs:273 ExportAllAsync -
2024-11-24 18:55:01.945 +01:00 [ERR] LibraryPage.xaml.cs:726 ExportRecordAsync -
2024-11-24 18:56:09.298 +01:00 [ERR] LibraryPage.xaml.cs:726 ExportRecordAsync -
2024-11-24 18:56:20.853 +01:00 [ERR] LibraryPage.xaml.cs:726 ExportRecordAsync -
2024-11-24 23:16:49.945 +01:00 [ERR] LibraryPage.xaml.cs:726 ExportRecordAsync -
2024-11-24 23:17:07.192 +01:00 [ERR] LibraryPage.xaml.cs:726 ExportRecordAsync -
2024-11-24 23:22:09.612 +01:00 [ERR] LibraryPage.xaml.cs:726 ExportRecordAsync -

@sodgaard sodgaard added the bug Something isn't working label Nov 24, 2024
@beeradmoore
Copy link
Owner

Hey @sodgaard ,
Could you please confirm what version of DLSS Swapper you are using?

Also are you trying to export the file directly into a game directory?

@sodgaard
Copy link
Author

Hi Brad. 1.0.5 I believe it is named - the latest.

I go to the list with all the downloads, and press the vertical Down Arrow to download. When that appears the horizontal arrow appears, and I try to press that. When doing that I get the error.

Last month I managed to update MSFS2020 DLSS with no problem. Now MSFS2024 also shows up and I wanted to download the latest DLSS for that.

BR

Stephen

@beeradmoore
Copy link
Owner

From the first part of the log it looks like you tried to swap the DLSS dll (from the games menu) for MSFS (unsure of 2020 or 2024) and it was open so then it failed.

2024-11-24 18:17:17.066 +01:00 [ERR] FileVersionInfoExtensions.cs:24 GetMD5Hash - C:\Program Files\WindowsApps\Microsoft.Limitless_1.1.9.0_x64__8wekyb3d8bbwe\nvngx_dlss.dll, The process cannot access the file 'C:\Program Files\WindowsApps\Microsoft.Limitless_1.1.9.0_x64__8wekyb3d8bbwe\nvngx_dlss.dll' because it is being used by another process.

But then the next parts looks like it is defaulting to system32 for some reason and it should not be trying to touch that.

2024-11-24 18:51:46.973 +01:00 [ERR] LibraryPage.xaml.cs:726 ExportRecordAsync -
2024-11-24 18:51:55.130 +01:00 [ERR] LocalRecord.cs:177 Delete - Could not find a part of the path 'C:\WINDOWS\system32\StoredData\dlss_zip\3.8.10.0_AED94E7029846C356882DB166B824F5E.zip'.

I think you are, but just to confirm, are you using the portable version?

@sodgaard
Copy link
Author

I just gave you the entire log file. Yes there seem to be a sharing violation in the first line.
It’s however the last 6-8 attempts including reboots in between that show the encountered errors.
I am using the portable version yes. :-)

@sodgaard
Copy link
Author

Just tried on my gaming laptop as well. Its exactly the same behaviour...

@sodgaard
Copy link
Author

One thing I have updated since the previous successfull use is upgrade to W11 24H2.
Could that cause the issue? I am running the Application as admin, so….

@beeradmoore
Copy link
Owner

Hey @sodgaard , I have been able to use it on Win 11 24H2 and 23H2 and didn't have the problems. However I was able to replicate the issue running DLSS Swapper as admin.

We did have this problem appear previously with #120 where I signed off saying that the issue should be fixed 😅

If you can confirm that running not as admin fixes it for you I'll try get that fixed for the next build.

If that is the case running as non-admin should allow you to export. If that isn't the case you can normally download DLSS files from TechPowerUp or from our own DLSS archive which is where DLSS Swapper loads from.

@sodgaard
Copy link
Author

As you point out it seem to be some kind of permissions problem. I had placed the files in a folder below Program Files (x86). I have now moved the folder out of (x86) and under C:/utils/DLSS Swapper. Here it functions fine..
But odd - it certainly functioned fine before 24H2 in its pervious location as well.

@FunktasticLucky
Copy link

FunktasticLucky commented Nov 26, 2024

I have the same issue. It must be a more recent patch to Windows 11 24H2 that is causing the problem. Portable works but the installed version will not.

Edit: So after reinstalling DLSS Swapper several times to different places and drives with no success. I installed DLSS Swapper and then moved the portable version over and overwrote all the files. It works now and I can just search for DLSS Swapper in the start menu. So there is something different between the 2 versions.

@beeradmoore
Copy link
Owner

beeradmoore commented Nov 26, 2024

I'll try go re-verify 24H2 with the installer version installed to its default location, but by the sounds of it the two of you are doing things that are not intended to be done.

I had placed the files in a folder below Program Files (x86)

Yeah, if you want it in Program Files you should use the installer. Portable version is so you can keep it on the desktop and all files it creates and uses are within that folder. If you wanted to you could also then copy it to a USB and go use it on another computer without installing it.

So there is something different between the 2 versions.

Yep! When the two versions are compiled different parts of the code are toggled. The main change is where files are stored. Portable version stores its files relative to the executable in the StoredData directory. Installer version will put files into %LocalAppData%/DLSS Swapper.

The reason the installer puts files here is because it is recommended where apps put changing files (eg, config files) as they can't access Program Files without granting administrator permissions. I think @sodgaard this may be why you were running as admin in the first place?

EDIT: But regardless of putting portable version into Program Files or not, if I have the portable version in my desktop folder and I run it as administrator I get the weird export errors. This is on my 23H2 dev machine, my 24H2 gaming machine is in my lounge room, I'll verify it there today.

Either way, this should not be happening, so I'll see what I can do to fix that.

@FunktasticLucky
Copy link

I had it in the stock folder, desktop, on the D drive in the root of the drive. Nothing worked even if running it as Admin. The portable version works no issue. So it must be some new weird permissions or protection in the appdata folder. Let me disable Windows defender and give it a try when I get home later.

@beeradmoore
Copy link
Owner

When you say nothing worked, do you mean nothing nothing? Couldn't swap DLSS for Steam games, couldn't download DLSS, couldn't export DLSS

@FunktasticLucky
Copy link

Swapping was fine. Just exporting didn't work. Sorry I wasn't more precise. Left it out cuz we were in a thread about exporting. The only thing in my log are the "[ERR] LibraryPage.xaml.cs:726 ExportRecordAsync -" even though I set it to verbose logging.

@beeradmoore
Copy link
Owner

Ah, I see what you mean now. All good. I'll try replicate those on my 24H2 machine later.

As for verbose logging, I would have imagined there should be more. I'll double check that with mine as well to see.

@FunktasticLucky
Copy link

Just to add more stuff to think about. I did a full windows update. It had some cumulative updates as well as a couple .net framework updates and it started to export. I rolled back to a previous system restore point without them and it no longer works. So I'm not sure if it's a cumulative update or one of the .net updates. I'm troubleshooting trying to find out which one of these updates is killing my performance in Star Citizen (Which is why I wiped my computer and reinstalled windows 11 in the first place) so I'll try and figure out which update fixes the issue.

@beeradmoore
Copy link
Owner

beeradmoore commented Nov 27, 2024

I don't think it should be that, but weird things are happening so I am open to anything being funky :P

I wouldn't imagine it is those .NET updates. While the project is written in .NET it is published with self-contained so it does not need .NET installed to run it as it has its own bundled version.

EDIT: But with any problem, more information is always a good thing so thanks for providing that.

@FunktasticLucky
Copy link

Alright. I BELIEVE it was KB5045934 .net update that installed and it works now. It's either that one or the KB5048162. I thought I wrote down which one it was but I think I got side tracked and didn't paste it to my notepad before I rebooted. But one of those fixed the problem for me.

@beeradmoore
Copy link
Owner

I checked on my 24H2 (26100.2454) machine, it has both KB5045934 and KB5048162 installed.

With a fresh copy of portable downloaded and running from Downloads folder on C I was able to download and export.

Moving that folder to root of D I was able to download and export.

Moving that folder to D:\Program Files\ (which asked for admin permission todo) I was able to download and export.

DLSS Swapper installer version that is installed to C:\Program Files\DLSS Swapper\ I was able to download and export.

Uninstalled and re-installed to D:\Program Files\DLSS Swapper\ and I was able to download and export BUT only after one thing, which reminded me of another bug. When you install DLSS Swapper from the installer, the installer itself runs as administrator as it needs to be able to write to Program Files. When you launch DLSS Swapper from the installer its first run will run as administrator (as it is launched from an application that is administrator). In this state I am able to get the export error to occour. If I close and re-open DLSS Swapper I can export fine again.

The only way I can replicate is if I run the executable as administrator for either portable or installable version.

The only thing in my log are the "[ERR] LibraryPage.xaml.cs:726 ExportRecordAsync -" even though I set it to verbose logging.

There is other stuff added at startup under the informational level and higher such as,

2024-11-27 17:34:20.234 +11:00 [INF] App launch - v1.0.5.0
2024-11-27 17:34:20.376 +11:00 [INF] ThemeWatcher.cs:101 Start - Dark, False

It could be possible settings didn't save when you re-launched it (due to these permissions errors) and it never actually stayed in its verbose mode.

Future versions of DLSS Swapper add bannners when running as administrator (#225) which would help confirm if it is running as administrator or not. Task manager details tab has an elevated column to show if it is running as adminstrator or not.

image

@beeradmoore
Copy link
Owner

Ok, update.

I debugger the code, and it looks like it fails when I tried to show the export dialog (FileSavePicker class in the code). So I looked up the docs for FileSavePicker and there is a section there for how to show this dialog in a desktop app that requires elevation.

When I can add that, this should fix the errors that say

[ERR] LibraryPage.xaml.cs:726 ExportRecordAsync -

(side note, annoying that the actual error here even when I debug it is a blank string)

I am still looking into the errors that say

2024-11-24 18:51:55.130 +01:00 [ERR] LocalRecord.cs:177 Delete - Could not find a part of the path 'C:\WINDOWS\system32\StoredData\dlss_zip\3.8.10.0_AED94E7029846C356882DB166B824F5E.zip'.

@sodgaard
Copy link
Author

sodgaard commented Dec 1, 2024

Thanks. Brad. After moving the folder location and not running as Admin all works fine. :-)

@infinitydev
Copy link

I encountered the same issues running the latest portable version. I have extracted the .zip to a subfolder of my Downloads folder, so no special directory. If I run DLSS Swapper elevated, all previously downloaded DLSS versions appear as not downloaded and all DLSS files I try to download cannot be swapped, exported or deleted. Apparently, DLSS Swapper tries to store them in C:\WINDOWS\system32\StoredData\ where it does not have permission to write.

This also happens if I run DLSS Swapper via the start menu search box in non-elevated mode. It picks up the .exe from my Downloads folder. I don't have the installer variant installed. If I run the portable .exe from its directory using Windows Explorer, all is fine. Previously downloaded DLLs are there and swapping works.

Do you use the current working directory to build paths in the portable version, e.g. by using relative paths? My guess is that the working directory is not set when the .exe is started in elevated mode or by other means like the start menu and it somehow defaults to C:\WINDOWS\system32. You should not use the current working directory (or relative paths), unless you set it yourself, e.g. by setting the working directory to the location of the .exe at startup.

@beeradmoore
Copy link
Owner

Thanks for the extra info, that is very helpful to help me debug.

From we were getting the path of the executable as getting the current working directory would return very weird stuff like what we are currently seeing. That is with AppContext.BaseDirectory. There is longer comments here of what I should do. Considering I ended that thread with "This should be fixed in v1.0.2" I will revisit.

@apfaffman
Copy link

apfaffman commented Dec 19, 2024

Just to pile it on here... ;)

Encountered this with 1.0.5.0 and 1.0.5.1 with the installed version, both as admin and non-admin. Didn't seem to matter where the application was installed (Program Files (x86) or with install folder at root of D:). Was able to work around it by using the portable version (1.0.5.0) in D:\DLSS Swapper\

Windows 10 22H2 (19045.5011)

also have Windows Desktop Runtime version 6.0.33, 8.0.7 and 8.0.8 installed. not sure if relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants