I am trying to change the Folder Address of a FTP type connection in the client script at run time. It works fine the 1st time I set it but it has no effect when set the 2nd time. I need this since the public FTP isn't accessible from the internal corp. network. The variable %FTPUrl% has been added in the Custom Session variable with a value of "value". I also inserted it in the Folder address field of the TrueUpdate server dialog. I can see that the %FTPUrl% is set properly the 1st time it enters the for loop but the 2nd time the GetServerFile tries to connect still on the 1st address even if the value of %FTPUrl% has been correctly set.
Here is my code:
-- Set the FTP server list
g_ServerFolders = {};
g_ServerFolders[1]="ftp.domain.ca/TrueUpdate/Product1/"; -- Public FTP
g_ServerFolders[2]="ftp://172.31.100.50/TrueUpdate/Product1/"; -- Internal FTP
for index, ServerFolder in g_ServerFolders do
SessionVar.Set("%FTPUrl%", ServerFolder);
Dialog.Message("Debug", SessionVar.Expand("%FTPUrl%"), MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
GotServerFiles = TrueUpdate.GetServerFile("TrueUpdateFTP", false, nil);
-- If the download was successful, run the server script
if (GotServerFiles) then
-- Save package location for server script
INIFile.SetValue(SessionVar.Expand("%SourceFolder% \\TrueUpdate.ini"), "PackageInfo", "URL", SessionVar.Expand("%FTPUrl%"));
-- Run server script
TrueUpdate.RunScript("Server Script");
break;
end
end
Is there a way to refresh the %FTPUrl% that the TrueUpdate.GetServerFiles is using?
Here is my code:
-- Set the FTP server list
g_ServerFolders = {};
g_ServerFolders[1]="ftp.domain.ca/TrueUpdate/Product1/"; -- Public FTP
g_ServerFolders[2]="ftp://172.31.100.50/TrueUpdate/Product1/"; -- Internal FTP
for index, ServerFolder in g_ServerFolders do
SessionVar.Set("%FTPUrl%", ServerFolder);
Dialog.Message("Debug", SessionVar.Expand("%FTPUrl%"), MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
GotServerFiles = TrueUpdate.GetServerFile("TrueUpdateFTP", false, nil);
-- If the download was successful, run the server script
if (GotServerFiles) then
-- Save package location for server script
INIFile.SetValue(SessionVar.Expand("%SourceFolder% \\TrueUpdate.ini"), "PackageInfo", "URL", SessionVar.Expand("%FTPUrl%"));
-- Run server script
TrueUpdate.RunScript("Server Script");
break;
end
end
Is there a way to refresh the %FTPUrl% that the TrueUpdate.GetServerFiles is using?
Comment