|
Post by fidokomik on Jun 5, 2005 19:23:35 GMT -5
I want to create autorun where I can to test if Adobe Acrobat is instaled in computer. How can I read the string from registry "default" value? For example Acrobat 6.0 create this registry key: REGEDIT4
[HKEY_CLASSES_ROOT\pdf_auto_file\shell\open\command] @="\"C:\\Program Files\\Adobe\\Acrobat 5.0\\Reader\\AcroRd32.exe\" %1" Is somewhere any sample how to test if exist the program in computer other then my program?
|
|
|
Post by Murariu Alexandru on Jun 6, 2005 17:04:32 GMT -5
You read the default registry value by using an empty string as the ValueName parameter
procedure RunPdfFile; //Might not always work because the 'pdf_auto_file' string could be represented by another string var S : string; begin { You read the default registry value by using an empty string as the ValueName parameter } RegQueryStringValue(HKEY_CLASSES_ROOT, 'pdf_auto_file\shell\open\command', '', S); S := Format(S, [RepConst('%SRCDIR%\file.pdf')]); FileExec(S, False, True); end;
procedure DetectAndRunPDF; var S : string; ERR : Integer; begin S := GetAssociatedProgram('PDF'); if not FileExists(S) then begin MessageBox('Acrobat Reader not installed!', 'Warning', MB_ICONWARNING); Exit; end; ShellExec(RepConst('%SRCDIR%\readme.pdf'),'','',SW_SHOWNORMAL,ERR); end;
|
|