diff options
author | Eilidh McAdam <eilidh@lanedo.com> | 2012-07-10 18:19:17 +0100 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-07-18 11:01:57 +0200 |
commit | a237b03f73574ac46de515fc4671b647d0a8168e (patch) | |
tree | 36504a4f17af243a60f80d34aa0e3a1c1eb8cd94 /setup_native | |
parent | 99716480586148354f4e43436c9e4411e674d57e (diff) |
Skeleton code for msimsp
Change-Id: I23349edcf15731a9a33b9698bd77893003682e39
Signed-off-by: Fridrich Štrba <fridrich.strba@bluewin.ch>
Diffstat (limited to 'setup_native')
-rw-r--r-- | setup_native/source/win32/wintools/msimsp/msimsp.c | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/setup_native/source/win32/wintools/msimsp/msimsp.c b/setup_native/source/win32/wintools/msimsp/msimsp.c new file mode 100644 index 000000000000..ebea6f035184 --- /dev/null +++ b/setup_native/source/win32/wintools/msimsp/msimsp.c @@ -0,0 +1,84 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <stdio.h> +#include <sys/stat.h> + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +void usage(void) +{ + printf( + "Usage: msimsp.exe -s [pcp_path] -p [msp_path] {options}\n" + "\nOptions:\n" + "-s <pcpfile> Required. Path to the patch creation properties (.pcp) file.\n" + "-p <mspfile> Required. Path to patch package being created (.msp)\n" + "-f <tmpdir> Path to temporary directory (default: %%TMP%%/~pcw_tmp.tmp/\n" + "-k Fail if temporary directory already exists\n" + "-l <logfile> Path to log file of patch creation process and errors\n" +/* "-lp <logfile> Path to log file (includes performance data).\n" + "-d Displays dialog on success\n"*/ + "-? or -h Display usage\n"); +} + +void createPatch(char * pcpFile, char * mspFile, char * tmpDir, char * logFile) +{ +} + +int main(int argc, char *argv[]) +{ + char * pcpFile = 0; + char * mspFile = 0; + char * tmpDir = 0; + char * logFile = 0; + BOOL chkTmpDir = FALSE; + struct stat s; + + /* Get parameters */ + while (argv[1] && (argv[1][0] == '-' || argv[1][0] == '/')) + { + switch(tolower(argv[1][1])) + { + case 's': + argv++; argc++; + pcpFile = argv[1]; + break; + case 'p': + argv++; argc++; + mspFile = argv[1]; + break; + case 'f': + argv++; argc++; + tmpDir = argv[1]; + break; + case 'k': + chkTmpDir = TRUE; + break; + case 'l': + argv++; argc++; + logFile = argv[1]; + break; + case '?': + case 'h': + usage(); + return 0; + } + argv++; argc++; + } + + if (chkTmpDir && stat(tmpDir, &s) == 0 && S_ISDIR(s.st_mode)) + { + printf("Temporary directory exists, please specify another or omit -k\n"); + return 2; + } + createPatch(pcpFile, mspFile, tmpDir, logFile); + + return 0; +} |