mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Fix another introduced bug in windows
git-svn-id: svn://ultimatepp.org/upp/trunk@4107 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
d84576f890
commit
2e06908dea
1 changed files with 22 additions and 22 deletions
|
|
@ -35,9 +35,9 @@ String Updater::GetPlatformRoot(void)
|
|||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
// constructor
|
||||
Updater::Updater()
|
||||
{
|
||||
// defaults to web server mode
|
||||
isWebServer = true;
|
||||
{
|
||||
// defaults to web server mode
|
||||
isWebServer = true;
|
||||
|
||||
// fetches and stores environment, we need to change it later
|
||||
environment <<= Environment();
|
||||
|
|
@ -556,22 +556,22 @@ void Updater::RestartApp(RestartModes restartMode)
|
|||
|
||||
// fetch list of available app versions
|
||||
ProductVersions Updater::FetchVersions(void)
|
||||
{
|
||||
String verStr;
|
||||
|
||||
if(isWebServer)
|
||||
{
|
||||
String verStr;
|
||||
|
||||
if(isWebServer)
|
||||
{
|
||||
HttpClient http;
|
||||
http.TimeoutMsecs(1000);
|
||||
http.URL(AppendFileName(GetPlatformRoot(), "versions"));
|
||||
http.URL(GetPlatformRoot() + "versions");
|
||||
|
||||
// fetch version file from server
|
||||
verStr = http.Execute();
|
||||
int err = http.GetStatusCode();
|
||||
if(err != 200)
|
||||
return ProductVersions();
|
||||
}
|
||||
else
|
||||
return ProductVersions();
|
||||
}
|
||||
else
|
||||
verStr = LoadFile(GetPlatformRoot() + "versions");
|
||||
|
||||
verStr = TrimBoth(verStr);
|
||||
|
|
@ -602,20 +602,20 @@ bool Updater::FetchApp(ProductVersion ver, bool devel)
|
|||
if(!ver)
|
||||
ver = FetchMaxValidVersion(acceptDevelVersions);
|
||||
if(!ver)
|
||||
return false;
|
||||
|
||||
return false;
|
||||
|
||||
String appServerPath, destPath;
|
||||
#ifdef PLATFORM_POSIX
|
||||
appServerPath = AppendFileName(GetPlatformRoot(), ver.ToString() + "/" + appName);
|
||||
appServerPath = GetPlatformRoot() + ver.ToString() + "/" + appName;
|
||||
destPath = AppendFileName(GetProgramsFolder(), appName);
|
||||
#else
|
||||
appServerPath = AppendFileName(GetPlatformRoot(), ver.ToString() + "/" + appName + ".exe");
|
||||
appServerPath = GetPlatformRoot() + ver.ToString() + "/" + appName + ".exe";
|
||||
destPath = AppendFileName(GetProgramsFolder(), appName + "/" + appName + ".exe");
|
||||
#endif
|
||||
|
||||
if(isWebServer)
|
||||
{
|
||||
HttpClient http;
|
||||
|
||||
if(isWebServer)
|
||||
{
|
||||
HttpClient http;
|
||||
http.URL(appServerPath);
|
||||
http.TimeoutMsecs(1000*60*30);
|
||||
http.MaxContentSize(100000000);
|
||||
|
|
@ -632,9 +632,9 @@ bool Updater::FetchApp(ProductVersion ver, bool devel)
|
|||
|
||||
// replaces/installs app
|
||||
if(!SaveFile(destPath, appBuffer))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
FileCopy(appServerPath, destPath);
|
||||
#ifdef PLATFORM_POSIX
|
||||
if(chmod(~destPath, 0755) != 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue