mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2024-11-22 20:01:20 +00:00
Merge branch 'master' of ssh://files/git/desktop/standalone-updater
This commit is contained in:
commit
a6a94f7b10
6 changed files with 23 additions and 15 deletions
|
@ -10,6 +10,10 @@ include_directories(external/zlib/)
|
|||
include_directories(external/win32cpp/include)
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
set(CMAKE_OSX_ARCHITECTURES i386;x86_64)
|
||||
endif()
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(external/AnyOption)
|
||||
add_subdirectory(external/minizip)
|
||||
|
|
|
@ -70,8 +70,7 @@ void UpdateDialogCocoa::init()
|
|||
int height = 100;
|
||||
|
||||
d->window = [[NSWindow alloc] initWithContentRect:NSMakeRect(200, 200, width, height)
|
||||
styleMask:NSTitledWindowMask | NSClosableWindowMask |
|
||||
NSMiniaturizableWindowMask
|
||||
styleMask:NSTitledWindowMask | NSMiniaturizableWindowMask
|
||||
backing:NSBackingStoreBuffered defer:NO];
|
||||
[d->window setTitle:@"Mendeley Updater"];
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ void UpdaterOptions::parseOldFormatArgs(int argc, char** argv)
|
|||
}
|
||||
else if (key == "UpdateScriptFileName")
|
||||
{
|
||||
script = value;
|
||||
scriptPath = value;
|
||||
}
|
||||
else if (key == "AppFileName")
|
||||
{
|
||||
|
@ -116,7 +116,7 @@ void UpdaterOptions::parse(int argc, char** argv)
|
|||
}
|
||||
if (parser.getValue("script"))
|
||||
{
|
||||
script = parser.getValue("script");
|
||||
scriptPath = parser.getValue("script");
|
||||
}
|
||||
if (parser.getValue("wait"))
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ class UpdaterOptions
|
|||
UpdateInstaller::Mode mode;
|
||||
std::string installDir;
|
||||
std::string packageDir;
|
||||
std::string script;
|
||||
std::string scriptPath;
|
||||
long long waitPid;
|
||||
std::string logFile;
|
||||
|
||||
|
|
|
@ -54,15 +54,15 @@ int main(int argc, char** argv)
|
|||
UpdateInstaller installer;
|
||||
UpdateScript script;
|
||||
|
||||
if (!options.script.empty())
|
||||
if (!options.scriptPath.empty())
|
||||
{
|
||||
script.parse(options.script);
|
||||
script.parse(options.scriptPath);
|
||||
}
|
||||
|
||||
LOG(Info,"started updater. install-dir: " + options.installDir
|
||||
+ ", package-dir: " + options.packageDir
|
||||
+ ", wait-pid: " + intToStr(options.waitPid)
|
||||
+ ", script-path: " + options.script
|
||||
+ ", script-path: " + options.scriptPath
|
||||
+ ", mode: " + intToStr(options.mode));
|
||||
|
||||
installer.setMode(options.mode);
|
||||
|
|
|
@ -7,12 +7,12 @@ void TestUpdaterOptions::testOldFormatArgs()
|
|||
{
|
||||
const int argc = 6;
|
||||
char* argv[argc];
|
||||
argv[0] = "updater";
|
||||
argv[1] = "CurrentDir=/path/to/app";
|
||||
argv[2] = "TempDir=/tmp/updater";
|
||||
argv[3] = "UpdateScriptFileName=/tmp/updater/file_list.xml";
|
||||
argv[4] = "AppFileName=/path/to/app/theapp";
|
||||
argv[5] = "PID=123456";
|
||||
argv[0] = strdup("updater");
|
||||
argv[1] = strdup("CurrentDir=/path/to/app");
|
||||
argv[2] = strdup("TempDir=/tmp/updater");
|
||||
argv[3] = strdup("UpdateScriptFileName=/tmp/updater/file_list.xml");
|
||||
argv[4] = strdup("AppFileName=/path/to/app/theapp");
|
||||
argv[5] = strdup("PID=123456");
|
||||
|
||||
UpdaterOptions options;
|
||||
options.parse(argc,argv);
|
||||
|
@ -20,8 +20,13 @@ void TestUpdaterOptions::testOldFormatArgs()
|
|||
TEST_COMPARE(options.mode,UpdateInstaller::Setup);
|
||||
TEST_COMPARE(options.installDir,"/path/to/app");
|
||||
TEST_COMPARE(options.packageDir,"/tmp/updater");
|
||||
TEST_COMPARE(options.script,"/tmp/updater/file_list.xml");
|
||||
TEST_COMPARE(options.scriptPath,"/tmp/updater/file_list.xml");
|
||||
TEST_COMPARE(options.waitPid,123456);
|
||||
|
||||
for (int i=0; i < argc; i++)
|
||||
{
|
||||
free(argv[i]);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int,char**)
|
||||
|
|
Loading…
Reference in a new issue