|
![]() |
#1 |
Senior Member
Join Date: Nov 2013
Location: Iran
Posts: 343
|
![]()
hi
i check many FTP plugin but not found in that's delete a file or files format (*.txt) and directory how can Possible delete File,Files,Directory from FTP? |
![]() |
![]() |
![]() |
#2 |
Senior Member
Join Date: Nov 2013
Location: Iran
Posts: 343
|
![]()
can remove directory from batch file
but do can do it with nsis? BatchFile Remove folder AAA From Host HTML Code:
@echo off echo FTPUSERNAME> DeleteDirectory.txt echo FTPPASSWORD>> DeleteDirectory.txt echo CD AAA>>DeleteDirectory.txt echo prompt>>DeleteDirectory.txt echo mdelete *>>DeleteDirectory.txt echo cd ..>>DeleteDirectory.txt echo RMdir AAA>>DeleteDirectory.txt echo disconnect>>DeleteDirectory.txt echo quit>>DeleteDirectory.txt ftp -s:DeleteDirectory.txt FTPADDRESS del DeleteDirectory.txt OR HTML Code:
@echo off echo open FTPADDRESS> DeleteDirectory2.txt echo FTPUSERNAME>> DeleteDirectory2.txt echo FTPPASSWORD>> DeleteDirectory2.txt echo CD AAA>>DeleteDirectory2.txt echo prompt>>DeleteDirectory2.txt echo mdelete *>>DeleteDirectory2.txt echo cd ..>>DeleteDirectory2.txt echo RMDIR AAA>>DeleteDirectory2.txt echo disconnect>>DeleteDirectory2.txt echo quit>>DeleteDirectory2.txt ftp -s:DeleteDirectory2.txt del DeleteDirectory2.txt i need a way for delete folder [Directory] with nsis There is a plugin to do this? |
![]() |
![]() |
![]() |
#3 |
Senior Member
Join Date: Nov 2013
Location: Iran
Posts: 343
|
I still did not find a method in nsis
except call to CMD! 1-is not possible upgrade inetc:: Plugin for Create Directory and Delete Directory in FTP? 2-Also is possible About inetc:: errors explain? When do they happen I encountered some of them But I do not know what time Other items are displayed! HTML Code:
TEXT("OK") TEXT("Connecting") TEXT("Downloading") TEXT("Cancelled") TEXT("Connecting"), //TEXT("Opening URL")) TEXT("Reconnect Pause") TEXT("Terminated") TEXT("Dialog Error") TEXT("Open Internet Error") TEXT("Open URL Error") TEXT("Transfer Error") TEXT("File Open Error") TEXT("File Write Error") TEXT("File Read Error") TEXT("Reget Error") TEXT("Connection Error") TEXT("OpenRequest Error") TEXT("SendRequest Error") TEXT("URL Parts Error") TEXT("File Not Found (404)") TEXT("CreateThread Error") TEXT("Proxy Error (407)"), TEXT("Access Forbidden (403)") TEXT("Not Allowed (405)") TEXT("Request Error") TEXT("Server Error") TEXT("Unauthorized (401)") TEXT("FtpCreateDir failed (550)") TEXT("Error FTP path (550)") TEXT("Not Modified"), TEXT("Redirection") |
![]() |
![]() |
![]() |
#4 |
Junior Member
Join Date: Apr 2014
Posts: 16
|
Integrated in OS ftp.exe don't works with passive mode, so is not good idea.
|
![]() |
![]() |
![]() |
#5 |
Senior Member
Join Date: Nov 2013
Location: Iran
Posts: 343
|
Yes,Ftp.exe haven't good access to server for complicated works
I have problem in ftp.exe for remove a directory with subdirectorys For example i have a directory with name 'Root' and in that is many folders without file I want to delete directory 'Root' with all subdirectorys How can do it with nsis or command line? |
![]() |
![]() |
![]() |
#7 |
Senior Member
Join Date: Nov 2013
Location: Iran
Posts: 343
|
I still can not solve the problem of deleting folders with files and subfolders
ftp.exe At times I do not know it is not working!!!! cURL too is an external application i need to a DLL to do delete directory with files and sub folders |
![]() |
![]() |
![]() |
#8 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,337
|
At this point I think you pretty much have to write it yourself or pay someone to write it for you.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#9 |
Senior Member
Join Date: Nov 2013
Location: Iran
Posts: 343
|
thanks Anders
i found a dll: Download link: https://www.limilabs.com/static/ftp/Ftp.zip Sample of code C# HTML Code:
using (Ftp client = new Ftp()) { client.Connect("ftp.example.org"); client.Login("user", "password"); client.CreateFolder("reports"); client.Rename("reports", "reports 2010"); client.DeleteFolder("reports 2010"); client.Close(); } now i want know is possible use from dll in nsis? i try this parameters but not work: HTML Code:
Section InitPluginsDir SetOutPath "$pluginsdir" File "DLL\Ftp.dll" System::Call "Ftp::Connect('$FTP_Root_Address')" System::Call "Ftp::Login('$FTP_Root_UserName', '$FTP_Root_PassWord')" System::Call "Ftp::CreateFolder('reports')" SectionEnd |
![]() |
![]() |
![]() |
#10 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,337
|
It it is C# then you must use https://nsis.sourceforge.io/Call_.NE...ethods_plug-in
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#11 |
Senior Member
Join Date: Nov 2013
Location: Iran
Posts: 343
|
i create a dll with C# for delete folder with files and sub folders in FTP
but when i want call to that with NSIS i see the message: this is my NSIS Code: HTML Code:
XPStyle on Var Ftp_Address Var Ftp_Username Var Ftp_Password Var Ftp_FolderName Section StrCpy $Ftp_Address "FTP.ADDRESS.COM" # $Ftp_Address StrCpy $Ftp_Username "USERNAME" # $Ftp_Username StrCpy $Ftp_Password "PASSWORD" # $Ftp_Password StrCpy $Ftp_FolderName "FOLDER NAME_YOU_WANT_DELETE_THAT" # $Ftp_FolderName InitPluginsDir SetOutPath $PLUGINSDIR File "DLL\*.*" CLR::Call /NOUNLOAD "FTPCityToolkit.dll" "FTPCityToolkit.DeleteFolderRecursively" "DeleteFtpFolder" 4 "$Ftp_Address" "$Ftp_Username" "$Ftp_Password" "$Ftp_FolderName" Pop $0 CLR::Destroy SectionEnd Also This is the FTPCityToolkit.dll SourceCode C#: HTML Code:
using Limilabs.FTP.Client; namespace FTPCityToolkit { public class DeleteFolderRecursively { public void DeleteFtpFolder(string FTPServerName, string FTPUsername, string FTPPassWord, string FTPRootFolderName) { using (Ftp client = new Ftp()) { client.Connect(FTPServerName); client.Login(FTPUsername, FTPPassWord); client.DeleteFolderRecursively(FTPRootFolderName); client.Close(); } } } } Also i attach the DLLs and DLL C# Project what is my Problem? i need help to solve this |
![]() |
![]() |
![]() |
#12 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,337
|
I would recommend that you create a simple C# app and test this .DLL. If that works then you probably have to run your installer in the Visual Studio debugger.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#13 | |
Senior Member
Join Date: Nov 2013
Location: Iran
Posts: 343
|
Quote:
I think the problem is due to the use of another DLL in my DLL in the program... Anyhow i'm building a DLL to do this And will be ready soon ![]() |
|
![]() |
![]() |
![]() |
|
Tags |
ftp |
Thread Tools | Search this Thread |
Display Modes | |
|
|