38 |
|
|
39 |
#define MIN_GPG_VER "1.4.3" /* Minimal GPG version. */ |
#define MIN_GPG_VER "1.4.3" /* Minimal GPG version. */ |
40 |
#define MIN_GPGME_VER "1.2.0" /* Minimal GPGME version. */ |
#define MIN_GPGME_VER "1.2.0" /* Minimal GPGME version. */ |
41 |
|
#define MIN_PTD_VER "0.8.1" /* Minimal PTD version. */ |
42 |
|
|
43 |
|
|
44 |
HINSTANCE glob_hinst; /* global instance for the dialogs */ |
HINSTANCE glob_hinst; /* global instance for the dialogs */ |
131 |
static const char * |
static const char * |
132 |
get_prog_part (const char * fname, int use_cwd) |
get_prog_part (const char * fname, int use_cwd) |
133 |
{ |
{ |
134 |
static char program[1024]; |
static char program[512]; |
135 |
char currdir[256], * cmd = NULL; |
char currdir[256]; |
136 |
|
char *cmd = NULL; |
137 |
int j; |
int j; |
138 |
|
|
139 |
memset (currdir, 0, DIM (currdir)); |
memset (currdir, 0, DIM (currdir)); |
147 |
cmd = GetCommandLine (); |
cmd = GetCommandLine (); |
148 |
if (cmd == NULL) |
if (cmd == NULL) |
149 |
return NULL; |
return NULL; |
150 |
strncpy (currdir, cmd, 255); |
strncpy (currdir, cmd, sizeof (currdir)-1); |
151 |
j = strlen (currdir); |
j = strlen (currdir); |
152 |
while (j--) { |
while (j--) { |
153 |
if (currdir[j] == '\\') |
if (currdir[j] == '\\') |
154 |
break; |
break; |
155 |
} |
} |
156 |
currdir[j] = 0; |
currdir[j] = 0; |
157 |
_snprintf (program, DIM (program)-1, "%s\\%s", currdir + 1, fname); |
_snprintf (program, DIM (program)-1, "%s\\%s", currdir + 1, fname); |
213 |
} |
} |
214 |
|
|
215 |
|
|
216 |
|
/* Enable the mobility mode. */ |
217 |
static void |
static void |
218 |
enable_mobile_mode (void) |
enable_mobile_mode (void) |
219 |
{ |
{ |
251 |
#endif |
#endif |
252 |
|
|
253 |
s = PTD_get_version (); |
s = PTD_get_version (); |
254 |
if (strcmp (s, "0.8.0")) { |
if (strcmp (s, MIN_PTD_VER)) { |
255 |
log_box (_("Privacy Tray Dynamic (PTD)"), MB_ERR, |
log_box (_("Privacy Tray Dynamic (PTD)"), MB_ERR, |
256 |
_("Please update your PTD.dll to the newest version, " |
_("Please update your PTD.dll to the newest version, " |
257 |
"the version (%s) you use is too old."), s); |
"the version (%s) you use is too old."), s); |
349 |
} |
} |
350 |
|
|
351 |
rc = gnupg_access_files (); |
rc = gnupg_access_files (); |
352 |
if (!start_gpgprefs && rc) |
if (!start_gpgprefs && rc) { |
353 |
{ |
if (rc == WPTERR_GPG_KEYRINGS || rc == WPTERR_GPG_OPT_KEYRINGS) { |
|
if (rc == WPTERR_GPG_KEYRINGS || rc == WPTERR_GPG_OPT_KEYRINGS) |
|
|
{ |
|
354 |
ec = msg_box (NULL, |
ec = msg_box (NULL, |
355 |
_("Could not access and/or find the public and secret keyring.\n" |
_("Could not access and/or find the public and secret keyring.\n" |
356 |
"If this is an accident, quit the program and fix it.\n\n" |
"If this is an accident, quit the program and fix it.\n\n" |
359 |
if (ec == IDYES) |
if (ec == IDYES) |
360 |
first_start = 1; |
first_start = 1; |
361 |
} |
} |
362 |
if (!first_start) |
if (!first_start) { |
|
{ |
|
363 |
msg_box (NULL, winpt_strerror (rc), _("WinPT Error"), MB_ERR); |
msg_box (NULL, winpt_strerror (rc), _("WinPT Error"), MB_ERR); |
364 |
return 0; |
return 0; |
365 |
} |
} |
366 |
} |
} |
367 |
|
|
368 |
if (!first_start) |
if (!first_start) { |
|
{ |
|
369 |
rc = gpg_check_permissions (1); |
rc = gpg_check_permissions (1); |
370 |
if (rc && rc == 2) |
if (rc && rc == 2) |
371 |
gpg_read_only = 1; |
gpg_read_only = 1; |
377 |
init_gnupg_table (); |
init_gnupg_table (); |
378 |
|
|
379 |
nfiles = fm_parse_command_line (cmdline); |
nfiles = fm_parse_command_line (cmdline); |
380 |
if (nfiles > 0) |
if (nfiles > 0) { |
381 |
|
free_gnupg_table (); |
382 |
return 0; |
return 0; |
383 |
|
} |
384 |
|
|
385 |
if (cmdline && stristr (cmdline, "--wipe-freespace")) { |
if (cmdline && stristr (cmdline, "--wipe-freespace")) { |
386 |
dialog_box_param (glob_hinst, (LPCTSTR)IDD_WINPT_SPACE_SECDEL, |
dialog_box_param (glob_hinst, (LPCTSTR)IDD_WINPT_SPACE_SECDEL, |