Penecruz / VAICOMPRO-Community

VAICOM PRO for DCS World
MIT License
163 stars 25 forks source link

[BUG] When I do a Vaicom update it just opens the update.cmd file in Notepad++. Doesn't update.. #116

Closed Snacko closed 6 months ago

Snacko commented 8 months ago

Describe the bug A clear and concise description of what the bug is. When Vaicom prompts for an update, it just opens the update.cmd file in Notepad++. It doesn't update..

To Reproduce Steps to reproduce the behavior: Click yes to update in the prompt.

Expected behavior It should 'run' the 'update.cmd' file, not 'open' it.

Screenshots

Additional context Add any other context about the problem here. When I remove the .cmd extension from Notepad++ File Associations vaicom updates correctly. I believe there is a way to tell the system to just 'run' the command, and not 'open' it in the associated program.

Penecruz commented 8 months ago

Hi Snacko, I'm unable to reproduce this, I gather you have .txt files opened always by Notepad++? It should run the command window and does on three systems I have tried it on.

The code calls for updater.cmd


{

    try
    {

        string basefolder = State.Proxy.SessionState["VA_APPS"] + "\\" + Products.Products.Families.Vaicom.VaicomProPlugin.rootfoldername + "\\";
        string localfolder = basefolder + "Updates" + "\\";

        if (File.Exists(basefolder + "updater.cmd"))
        {
            File.Delete(basefolder + "updater.cmd");
        }

        if (Directory.Exists(localfolder))
        {
            Directory.Delete(localfolder, true);
        }

    }
    catch (Exception e)
    {
        Log.Write("Cleanup: " + e.Message, Colors.Text);
    }

}```
Snacko commented 8 months ago

As I said in the last sentence of my original post, I changed Notepad++ and removed it's .cmd file association. Then ran the update again, and it worked fine. It was not opened in Notepad++.

I think I have also had .bat files called from programs to run, and I also have .bat files associated with Notepad++. But they just run and don't open in Notepad++.

I think you understand what I mean? And if it doesn't do that on your systems, then maybe there is something with .cmd files on my system that is causing this. It just started with this last release. But I did just reinstall a fresh windows 10 pro about 5 weeks ago, so maybe something is different on this OS?

Anyhow, if nobody else has this problem, then don't waste any time on it. It was just surprising that it happened, and I had never seen that before..

Cheers!! And thanks for all of your great work!!

Penecruz commented 8 months ago

No worries, Thanks I'll leave this issue open for while in case anyone else has the issue and comments.

Penecruz commented 6 months ago

Closeing now as no further eports. thanks for the original report.