auto updater

Status
This thread has been locked.

Nathan

Discord Bot Developer
Supreme
Feedback score
50
Posts
372
Reactions
329
Resources
2
I have a piece of code which downloads a plugin from a direct download URL
I also have some code which will check if there is a new version out

I need you to code something where the plugin deletes itself from the plugins folder. I'm not sure if this is possible so i will accept it if your code can delete a different plugin from the plugins folder


Discord: !AmANoot#0123
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

ZoiBox

Java dev & Setup Specialist
Supreme
Feedback score
3
Posts
754
Reactions
228
Resources
0
I dont believe this is possible
 

Vhbob

Professional Plugin Developer
Premium
Feedback score
4
Posts
62
Reactions
29
Resources
0
PHP:
// Java program to delete a file
import java.io.*;
 
public class Test
{
    public static void main(String[] args)
    {
        File file = new File("C:\\Users\\Mayank\\Desktop\\1.txt");
         
        if(file.delete())
        {
            System.out.println("File deleted successfully");
        }
        else
        {
            System.out.println("Failed to delete the file");
        }
    }
}

You can try something like this. Make sure the plugin is disabled and no longer being used by the server. It still might fail as the "File is currently running in another program" message may stop it.
 

Nathan

Discord Bot Developer
Supreme
Feedback score
50
Posts
372
Reactions
329
Resources
2
PHP:
// Java program to delete a file
import java.io.*;
 
public class Test
{
    public static void main(String[] args)
    {
        File file = new File("C:\\Users\\Mayank\\Desktop\\1.txt");
        
        if(file.delete())
        {
            System.out.println("File deleted successfully");
        }
        else
        {
            System.out.println("Failed to delete the file");
        }
    }
}

You can try something like this. Make sure the plugin is disabled and no longer being used by the server. It still might fail as the "File is currently running in another program" message may stop it.
Thanks a lot, I'll try it
 
Status
This thread has been locked.
Top