Giter Club home page Giter Club logo

Comments (49)

ElPumpo avatar ElPumpo commented on May 30, 2024 2

TinyNvidiaUpdateChecker v1.11.0-beta.zip this build has the workaround @darealshinji mentioned. Everyone please try it and report back.

from tinynvidiaupdatechecker.

indivisible avatar indivisible commented on May 30, 2024 1

I'm always getting an error from 7zip that translates to "The process cannot access the file because it's already being used by another process":

Error from the gist:
System.IO.IOException: 'The process cannot access the file 'C:\Users\me\source\repos\ConsoleApp1\ConsoleApp1\bin\Debug\test.zip' because it is being used by another process.'

It sure looks suspiciously similar.

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024 1

Please try the new build.zip (didn't mean to close the issue)

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024 1

Yet again dude thanks a lot for helping me out! The code example you provided me with helped me understand what was really going on. Releasing v1.12.0 as we speak.

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

At least 2 other people have reported this exact issue.

Have you tried 7zip 17.01? And what version of 7zip are you currently using

from tinynvidiaupdatechecker.

darealshinji avatar darealshinji commented on May 30, 2024

I was using 16.01. I've now installed 17.04 but in the meanwhile I had updated my drivers manually with the downloaded setup file, so now it just shows that my drivers are up to date.

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

Try running the application again with the --force-dl command line argument. I suspect this is a bug related to 7-zip and not the application

from tinynvidiaupdatechecker.

darealshinji avatar darealshinji commented on May 30, 2024

Weird, now it can't find 7zip at all, neither if it's 16.04 or 17.01. Location is always C:\Program Files\7-Zip.
Can't you just bundle the command line version of 7z.exe and use that instead?

Or what about this: if I get it right 7zip is used to extract components for a minimal installation, right? Why not add an option to just start the installer non-quietly so that I can decide which features I want? Because if I click Download + Install it'll perform a silent full installation since it doesn't find 7zip.

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

Did you install 7-Zip using the default installer? It should detect the registry keys that the installer creates, and I don't want to implement an automatic download of 7-Zip if you don't have it installed because who doesn't have 7zip (or winrar) in the first place?
Are you on a amd64 system?

from tinynvidiaupdatechecker.

darealshinji avatar darealshinji commented on May 30, 2024

I've reinstalled 7zip using the .exe installer instead of .msi package and now it works. I'm on x64.
If 7zip isn't found in the registry, why not look into the default installation directories?

%ProgramFiles%\7-Zip\7zG.exe
%ProgramFiles(x86)%\7-Zip\7zG.exe

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

Oh the msi installer (shit)? I'll add support for it. Look in #29 for MSI installer support

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

v1.10.0 released! try the build and report!

from tinynvidiaupdatechecker.

albpara avatar albpara commented on May 30, 2024

Had same error on 1.10.0

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

@albpara what error? What version of 7-Zip are you using?

from tinynvidiaupdatechecker.

albpara avatar albpara commented on May 30, 2024

Same error described on the issue, of course.

I was using (mostly sure) the .msi version. I just removed it and downloaded the latest .exe installer and it worked, but unfortunately, version 1.10.0 still threw the error

from tinynvidiaupdatechecker.

darealshinji avatar darealshinji commented on May 30, 2024

Having this issue again, but I figured something out:
If I select "Download + Extract" I get the same error after the download finished. But if I select "Download + Extract" a second time and chose the directory with the already downloaded installer the extraction works.

By the way maybe using SevenZipSharp is an option?

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

@albpara ok... You never answered what version of 7-Zip you're using

@darealshinji what version of 7-Zip are you using?

Thanks a lot for the feedback btw!

from tinynvidiaupdatechecker.

albpara avatar albpara commented on May 30, 2024

Sorry @ElPumpo, I didn’t mention the version because as I said, I updated my 7-zip to latest and I didn't check before erasing.... I assume that I was using a 16.x but certainly, I am just gessing, sorry about that :(

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

@albpara then try 7-Zip 17.xx versions instead, currently 17.01 which can be found here

As I've said before I highly suspect that this problem is caused by 7-Zip and not TNUC, I'll do some more digging once you can confirm if the 17.xx version solves the issue. This did not occur me whilst implementing 7-Zip support.

from tinynvidiaupdatechecker.

darealshinji avatar darealshinji commented on May 30, 2024

Deactivating Windows Defender (temporarily) fixes the problem for me.

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

Then this is a bug related to Defender, and not TNUC. But why can't 7-Zip extract a file used by another process.. kinda silly

from tinynvidiaupdatechecker.

darealshinji avatar darealshinji commented on May 30, 2024

Good question. I wonder if saving the .exe as .7z would trick Defender.

from tinynvidiaupdatechecker.

darealshinji avatar darealshinji commented on May 30, 2024

Changing the extension does nothing. However I did some testing and figured out a few things:

  1. WinRAR has no such issues.

  2. Running TNUC with --quiet does work, 7zG shows no errors and extracts files on the first try. Not sure what's so different about this.

  3. Changing the part here to

try {
    SevenZip.Start();
    SevenZip.WaitForExit();
    SevenZip.Start();
    SevenZip.WaitForExit();
} catch (Exception ex) {

makes the second attempt succeed, just as expected.

Update

Making the app wait a bit before starting 7z seems to fix it:

--- a/TinyNvidiaUpdateChecker/MainConsole.cs
+++ b/TinyNvidiaUpdateChecker/MainConsole.cs
@@ -1006,6 +1006,7 @@ private static void MakeInstaller(bool silent)
                     SevenZip.StartInfo.UseShellExecute = false;
                     SevenZip.StartInfo.CreateNoWindow = true; // don't show the console in our console!
                     try {
+                        System.Threading.Thread.Sleep(1000);
                         SevenZip.Start();
                         SevenZip.WaitForExit();
                     } catch (Exception ex) {

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

This is really strange... what's causing it...... If you're sure that Thread.Sleep(1000); will make it work, then I'll add it to the code.

from tinynvidiaupdatechecker.

exadeci avatar exadeci commented on May 30, 2024

@ElPumpo I have the same issue even with 1.10 and just extract fails too.

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

@exadeci this bug doesn't seem to be caused by my application, what version of 7-Zip are you using?

from tinynvidiaupdatechecker.

exadeci avatar exadeci commented on May 30, 2024

@ElPumpo The last stable one 16.04 (2016-10-04) http://www.7-zip.org/download.html

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

@exadeci then try 17.01

from tinynvidiaupdatechecker.

darealshinji avatar darealshinji commented on May 30, 2024

v1.11.0 failed on my first attempt but then it succeeded on all later attempts for me.

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

Can you confirm that it's caused by Defender?

from tinynvidiaupdatechecker.

darealshinji avatar darealshinji commented on May 30, 2024

v1.10 fails with Defender on and succeeds with with Defender off. v1.11 succeeds even if Defender is on.

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

Ok, how about running the application with --quiet, as it uses 7z.exe instead of 7zG.exe

from tinynvidiaupdatechecker.

darealshinji avatar darealshinji commented on May 30, 2024

That's working but it shows a GUI, so is it really using 7z.exe?

screen-2017-11-11_18-14-23

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

Wouuups! My bad - you should use the following arguments: --confirm-dl --quiet --force-dl

from tinynvidiaupdatechecker.

darealshinji avatar darealshinji commented on May 30, 2024

It's downloading the driver into %TEMP%/388.13, silently. But it doesn't seem to do anything else.

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

It runs the nvidia installer without any user interaction, you sure it didn't update your drivers?

from tinynvidiaupdatechecker.

darealshinji avatar darealshinji commented on May 30, 2024

I've checked it again and running TinyNvidiaUpdateChecker.exe --confirm-dl on v1.10 updates the driver without any issues.

from tinynvidiaupdatechecker.

indivisible avatar indivisible commented on May 30, 2024

This looks like a race condition: sometimes you try to extract (read) the file that's still open for writing (the download).

I'm not quite familiar with webclient, but maybe the DownloadFileCompleted event should be used, as that's fired later. As I understand DownloadProgressChanged is fired as soon as data is received from the network, before writing it to the file.

if (e.BytesReceived >= e.TotalBytesToReceive) notifier.Set();

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

I honestly don't know what to do @darealshinji, I've been too lazy (sorry) to test with Defender enabled, I use a third party anti-malware program instead so I have always had Defender disabled.

@indivisible I'm sure that the downloader has nothing to do with it, you can try it yourself if you already have the driver file downloaded and select its folder in TNUC. Also if this were the case, then it would occur to WinRAR users aswell (including me?).

I am taking @darealshinji's word that Defender is causing this problem, but I'll test it myself soon enough.

from tinynvidiaupdatechecker.

indivisible avatar indivisible commented on May 30, 2024

@ElPumpo 7zip complains about the file being used by another process. Not much else can happen to it to lock out reading.

A lot of things can cause one application to sometimes fail and another to succeed: time from beginning of execution to point of opening the file, how it tries to handle locked files, etc.

There's a really small window of time when this error can occour, so it's normal that many people never see it.

I've looked at the reference implementation of webclient, and it really does fire the progress changed event before actually writing the bytes, so the current behaviour is incorrect anyway.

from tinynvidiaupdatechecker.

darealshinji avatar darealshinji commented on May 30, 2024

Maybe you should recommend only WinRar or point out that there might be issues with 7zip until this is fixed.

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

I'll take a closer look on this issue sooner lor later, but it must be said that I have not contributed enough the past weeks than what I used to. Feel free to help me fixing this issue.

from tinynvidiaupdatechecker.

SyntaxErrol avatar SyntaxErrol commented on May 30, 2024

Issue persists with v1.11.0 and 7-zip 18.01.

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

I still don't get why you guys are experiencing this and I don't. If someone could reproduce it, it could be a great help to fix this issue. @darealshinji's mentioned fix apparently doesn't work. Alternative I'll get started on implementing #35

from tinynvidiaupdatechecker.

indivisible avatar indivisible commented on May 30, 2024

https://gist.github.com/indivisible/eb4cca2f2465dc80ddf9df180b02971c

There you go, small demonstration that should work for you too.

The PR I submitted is trash, I noticed that you have the exact same download code twice and I only patched 1 of them, badly (need to check 2 fields as you mentioned).

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

I don't think that this is related to the downloader tho, how about we try to isolate the extracting process and let you guys test it.
Thinking about it you can isolate the downloading process by downloading the driver, then exit the program (the driver file will be saved). Now run the application and it'll try to extract it. (requires the second option, do not use the automatic install)

from tinynvidiaupdatechecker.

ElPumpo avatar ElPumpo commented on May 30, 2024

Sorry for being retarded, expect a beta build fixing this bug in 4 minutes. Thanks for your help.

from tinynvidiaupdatechecker.

indivisible avatar indivisible commented on May 30, 2024

Seems to work now. Thanks a lot!

from tinynvidiaupdatechecker.

indivisible avatar indivisible commented on May 30, 2024

You're welcome!

from tinynvidiaupdatechecker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.