127 |
return NULL; |
return NULL; |
128 |
strncpy (currdir, cmd, 255); |
strncpy (currdir, cmd, 255); |
129 |
j = strlen (currdir); |
j = strlen (currdir); |
130 |
while (j--) |
while (j--) { |
|
{ |
|
131 |
if (currdir[j] == '\\') |
if (currdir[j] == '\\') |
132 |
break; |
break; |
133 |
} |
} |
206 |
gpgme_set_pgm_string ("WinPT "PGM_VERSION); |
gpgme_set_pgm_string ("WinPT "PGM_VERSION); |
207 |
|
|
208 |
s = PTD_get_version (); |
s = PTD_get_version (); |
209 |
if (strcmp (s, "0.8.0")) |
if (strcmp (s, "0.8.0")) { |
|
{ |
|
210 |
log_box (_("Privacy Tray Dynamic (PTD)"), MB_ERR, |
log_box (_("Privacy Tray Dynamic (PTD)"), MB_ERR, |
211 |
_("Please update your PTD.dll to the newest version, " |
_("Please update your PTD.dll to the newest version, " |
212 |
"the version (%s) you use is too old."), s); |
"the version (%s) you use is too old."), s); |
213 |
return 0; |
return 0; |
214 |
} |
} |
215 |
|
|
216 |
if (gpg_md_selftest ()) |
if (gpg_md_selftest ()) { |
|
{ |
|
217 |
msg_box (NULL, _("Cryptographic selftest failed."), |
msg_box (NULL, _("Cryptographic selftest failed."), |
218 |
_("WinPT Error"), MB_ERR); |
_("WinPT Error"), MB_ERR); |
219 |
return 0; |
return 0; |
222 |
set_default_kserver (); |
set_default_kserver (); |
223 |
regist_inst_gnupg (1); |
regist_inst_gnupg (1); |
224 |
regist_inst_winpt (1, &created); |
regist_inst_winpt (1, &created); |
225 |
if (!created) |
if (!created) { |
|
{ |
|
226 |
memset (®_prefs, 0, sizeof (reg_prefs)); |
memset (®_prefs, 0, sizeof (reg_prefs)); |
227 |
reg_prefs.use_tmpfiles = 1; /* default */ |
reg_prefs.use_tmpfiles = 1; /* default */ |
228 |
|
reg_prefs.fm.progress = 0; /* XXX: fix the bug and enable it again */ |
229 |
get_reg_winpt_prefs (®_prefs); |
get_reg_winpt_prefs (®_prefs); |
230 |
if (!reg_prefs.no_hotkeys) |
if (!reg_prefs.no_hotkeys) |
231 |
hotkeys_modify (); |
hotkeys_modify (); |
232 |
} |
} |
233 |
|
|
234 |
rc = gnupg_check_homedir (); |
rc = gnupg_check_homedir (); |
235 |
if (rc) |
if (rc) { |
|
{ |
|
236 |
log_box (_("WinPT Error"), MB_ERR, |
log_box (_("WinPT Error"), MB_ERR, |
237 |
_("GPG home directory is not set correctly.\n" |
_("GPG home directory is not set correctly.\n" |
238 |
"Please check the GPG registry settings:\n%s."), |
"Please check the GPG registry settings:\n%s."), |
261 |
gnupg_check_homedir (); /* change gpgProgram if needed */ |
gnupg_check_homedir (); /* change gpgProgram if needed */ |
262 |
} |
} |
263 |
} |
} |
264 |
else |
else { |
|
{ |
|
265 |
msg_box (NULL, _("GPG home directory could not be determited."), |
msg_box (NULL, _("GPG home directory could not be determited."), |
266 |
_("WinPT Error"), MB_ERR); |
_("WinPT Error"), MB_ERR); |
267 |
goto start; |
goto start; |
269 |
} |
} |
270 |
|
|
271 |
rc = check_gnupg_prog (); |
rc = check_gnupg_prog (); |
272 |
if (rc) |
if (rc) { |
|
{ |
|
273 |
if (msg_box (NULL, _("Could not find the GPG binary (gpg.exe).\n" |
if (msg_box (NULL, _("Could not find the GPG binary (gpg.exe).\n" |
274 |
"Do you want to start the GPG preferences to " |
"Do you want to start the GPG preferences to " |
275 |
"correct this problem?"), _("WinPT Error"), |
"correct this problem?"), _("WinPT Error"), |
423 |
hwnd, keygen_wizard_dlg_proc, (LPARAM)&c); |
hwnd, keygen_wizard_dlg_proc, (LPARAM)&c); |
424 |
if (!rc) |
if (!rc) |
425 |
goto start; |
goto start; |
|
update_keycache (hwnd); |
|
|
check_crypto_engine (); |
|
426 |
break; |
break; |
427 |
|
|
428 |
case SETUP_IMPORT: |
case SETUP_IMPORT: |
431 |
msg_box (hwnd, winpt_strerror (rc), _("WinPT Error"), MB_ERR); |
msg_box (hwnd, winpt_strerror (rc), _("WinPT Error"), MB_ERR); |
432 |
goto start; |
goto start; |
433 |
} |
} |
|
update_keycache (hwnd); |
|
|
check_crypto_engine (); |
|
434 |
break; |
break; |
435 |
|
|
436 |
case SETUP_EXISTING: |
case SETUP_EXISTING: |
437 |
break; /* todo */ |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_GPGPREFS, hwnd, |
438 |
|
gpgprefs_dlg_proc, NULL); |
439 |
|
break; |
440 |
|
|
441 |
case -1: |
case -1: |
442 |
DestroyWindow (hwnd); |
DestroyWindow (hwnd); |
443 |
free_gnupg_table (); |
free_gnupg_table (); |
444 |
return 0; |
return 0; |
445 |
} |
} |
446 |
|
update_keycache (hwnd); |
447 |
|
check_crypto_engine (); |
448 |
} |
} |
449 |
else { |
else { |
450 |
gpgme_keycache_t c; |
gpgme_keycache_t c; |