Hello @ferdinand
Thank you for a such detailed answer.
I've pasted your code in my project but received the error during compiling when I call SomeFunction() in another place of project.
So I've changed it little bit to this and now it works perfectly:
void DownloadUpdates()
{
iferr_scope_handler
{
GePrint(err.GetMessage());
return;
};
const maxon::Url url("https://mysite.com/somefile.jpg"_s);
const maxon::UrlScheme scheme = url.GetScheme();
const maxon::Bool isHTTP = scheme == maxon::URLSCHEME_HTTP;
const maxon::Bool isHTTPS = scheme == maxon::URLSCHEME_HTTPS;
if (isHTTP || isHTTPS)
{
const maxon::InputStreamRef inputStream = url.OpenInputStream() iferr_return;
const maxon::Int length = inputStream.GetStreamLength() iferr_return;
maxon::BaseArray<maxon::Char> data;
data.Resize(length) iferr_return;
inputStream.Read(data) iferr_return;
inputStream.Close() iferr_return;
const maxon::Url someUrl(GeGetPluginPath().GetString());
const maxon::Url anotherUrl = (someUrl + url.GetName()) iferr_return;
const maxon::OutputStreamRef outputStream = anotherUrl.OpenOutputStream() iferr_return;
outputStream.Write(data) iferr_return;
outputStream.Close() iferr_return;
}
}
Thank you.
One last question: does the way to rewrite the .xdl64 plugin file during Cinema 4D is going to work exist? (OR at least replace it after Cinema 4D was closed?)
Or I will be needed to ask user to install updates manually?