X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=installer%2Finstaller.c;h=d22efd56f115fa4f40001f2d1c1a3f63391e156b;hp=05017f4d85890a6ae33831d8e40869cacd60290b;hb=4372ebe4a0e2197cf8f9e5f7af1decadf7ef44f6;hpb=e0ec3fa71d079e7a289c624bf8aa9fd1957d2f5a diff --git a/installer/installer.c b/installer/installer.c index 05017f4..d22efd5 100644 --- a/installer/installer.c +++ b/installer/installer.c @@ -44,6 +44,7 @@ static char path_programfiles[MAX_PATH] = "\0"; static char pathBuf[MAX_PATH]; static int do_abort = 0; +static char* pdf2swf_dir; static char* pdf2swf_path; static char registry_path[1024]; @@ -425,7 +426,7 @@ BOOL CALLBACK PropertySheetFunc2(HWND hwnd, UINT message, WPARAM wParam, LPARAM } } if(message == WM_NOTIFY && (((LPNMHDR)lParam)->code == PSN_SETACTIVE)) { - if(!elevated && !has_full_access && config_forAllUsers) { + if(!elevated && !has_full_access) { OSVERSIONINFO winverinfo; memset(&winverinfo, 0, sizeof(OSVERSIONINFO)); winverinfo.dwOSVersionInfoSize = sizeof(winverinfo); @@ -533,7 +534,7 @@ BOOL CALLBACK PropertySheetFunc3(HWND hwnd, UINT message, WPARAM wParam, LPARAM SetDlgItemText(hwnd, IDC_SPACE2, ""); PropSheet_SetWizButtons(dialog, 0); SendMessage(dialog, PSM_CANCELTOCLOSE, 0, 0); //makes wine display a warning - SetDlgItemText(hwnd, IDC_TITLE, "Installing files..."); + SetDlgItemText(hwnd, IDC_TITLE, "Installing..."); statuswnd = hwnd; status_t status; status.status = PropertyArchiveStatus; @@ -557,16 +558,21 @@ static HRESULT (WINAPI *f_SHGetSpecialFolderPath)(HWND hwnd, LPTSTR lpszPath, in BOOL CALLBACK PropertySheetFunc4(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { if(message == WM_INITDIALOG) { - pdf2swf_path = concatPaths(install_path, "pdf2swf_gui.exe"); + pdf2swf_dir = install_path; //concatPaths(install_path, "gpdf2swf"); + pdf2swf_path = concatPaths(pdf2swf_dir, "gpdf2swf.exe"); FILE*fi = fopen(pdf2swf_path, "rb"); if(fi) { printf("a GUI program exists, creating desktop/startmenu links\n"); config_createLinks = 1; fclose(fi); + } else { + config_createLinks = 0; + config_createStartmenu = 0; + config_createDesktop = 0; } if(!config_createLinks) { - SendDlgItemMessage(hwnd, IDC_STARTMENU, SW_HIDE, 0, 0); - SendDlgItemMessage(hwnd, IDC_DESKTOP, SW_HIDE, 0, 0); + SendDlgItemMessage(hwnd, IDC_STARTMENU, BN_DISABLE, 0, 0); + SendDlgItemMessage(hwnd, IDC_DESKTOP, BN_DISABLE, 0, 0); } SendDlgItemMessage(hwnd, IDC_STARTMENU, BM_SETCHECK, config_createStartmenu, 0); @@ -575,13 +581,17 @@ BOOL CALLBACK PropertySheetFunc4(HWND hwnd, UINT message, WPARAM wParam, LPARAM if(message == WM_COMMAND) { if((wParam&0xffff) == IDC_STARTMENU) { config_createStartmenu = SendDlgItemMessage(hwnd, IDC_STARTMENU, BM_GETCHECK, 0, 0); - config_createStartmenu^=1; + if(config_createLinks) { + config_createStartmenu^=1; + } SendDlgItemMessage(hwnd, IDC_STARTMENU, BM_SETCHECK, config_createStartmenu, 0); return 0; } if((wParam&0xffff) == IDC_DESKTOP) { config_createDesktop = SendDlgItemMessage(hwnd, IDC_DESKTOP, BM_GETCHECK, 0, 0); - config_createDesktop^=1; + if(config_createLinks) { + config_createDesktop^=1; + } SendDlgItemMessage(hwnd, IDC_DESKTOP, BM_SETCHECK, config_createDesktop, 0); return 0; } @@ -615,7 +625,7 @@ BOOL CALLBACK PropertySheetFunc4(HWND hwnd, UINT message, WPARAM wParam, LPARAM if(config_createDesktop && path_desktop[0]) { char* linkName = concatPaths(path_desktop, "pdf2swf.lnk"); printf("Creating desktop link %s -> %s\n", linkName, pdf2swf_path); - if(!CreateShortcut(pdf2swf_path, "pdf2swf", linkName, 0, 0, 0, install_path)) { + if(!CreateShortcut(pdf2swf_path, "pdf2swf", linkName, 0, 0, 0, pdf2swf_dir)) { MessageBox(0, "Couldn't create desktop shortcut", INSTALLER_NAME, MB_OK); return 1; } @@ -625,7 +635,7 @@ BOOL CALLBACK PropertySheetFunc4(HWND hwnd, UINT message, WPARAM wParam, LPARAM CreateDirectory(group, 0); addDir(group); char* linkName = concatPaths(group, "pdf2swf.lnk"); - if(!CreateShortcut(pdf2swf_path, "pdf2swf", concatPaths(group, "pdf2swf.lnk"), 0, 0, 0, install_path) || + if(!CreateShortcut(pdf2swf_path, "pdf2swf", concatPaths(group, "pdf2swf.lnk"), 0, 0, 0, pdf2swf_dir) || !CreateShortcut(uninstall_path, "uninstall", concatPaths(group, "uninstall.lnk"), 0, 0, 0, install_path)) { MessageBox(0, "Couldn't create start menu entry", INSTALLER_NAME, MB_OK); return 1;