wickerwolf Posted August 16, 2006 Posted August 16, 2006 hey, ive made a silent istall for this but how can i have it so its the default program for opening .pdf files automatically without haing to open the program first and set it to the default pdf viewer?
mazin Posted August 16, 2006 Posted August 16, 2006 You only need the EXE. I rename it to PDFread.exe and put it in %SystemRoot%\PDFread.exe then apply this reg file.Windows Registry Editor Version 5.00[HKEY_CURRENT_USER\Software\Local AppWizard-Generated Applications\Foxit PDF Reader\MainFrame]"ShowTollBar"="1""ShowStatusBar"="1""ShowMenu"="1""MainShowCmd"="3""ShowFullScreen"="0""CheckRegister"="0"[HKEY_USERS\.DEFAULT\Software\Local AppWizard-Generated Applications\Foxit PDF Reader\MainFrame]"ShowTollBar"="1""ShowStatusBar"="1""ShowMenu"="1""MainShowCmd"="3""ShowFullScreen"="0""CheckRegister"="0"[HKEY_CLASSES_ROOT\.pdf]@="AcroExch.Document"[HKEY_CLASSES_ROOT\AcroExch.Document]"EditFlags"=dword:00000000"BrowserFlags"=dword:00000008@=""[HKEY_CLASSES_ROOT\AcroExch.Document\shell]@="Open_With_PDF-Reader"[HKEY_CLASSES_ROOT\AcroExch.Document\shell\Open_With_PDF-Reader]@="Open With PDF-Reader"[HKEY_CLASSES_ROOT\AcroExch.Document\shell\Open_With_PDF-Reader\command]@="PDFread.exe \"%1\""
InTheWayBoy Posted August 16, 2006 Posted August 16, 2006 I do the same as mazin does, I drop the exe (which I rename to foxit.exe) into a directory and then run an AutoIt script to handle all the dirty work. The bulk of it is registry changes, here is the script:RegWrite("HKCR\.pdf","","REG_SZ","FoxitReader.Document")RegWrite("HKCR\.pdf","Content Type","REG_SZ","application/pdf")RegWrite("HKCR\CLSID\{14E8BBD8-1D1C-4D56-A4DA-D20B75EB814E}","","REG_SZ","PDF Document")RegWrite("HKCR\CLSID\{14E8BBD8-1D1C-4D56-A4DA-D20B75EB814E}\AuxUserType\2")RegWrite("HKCR\CLSID\{14E8BBD8-1D1C-4D56-A4DA-D20B75EB814E}\AuxUserType\3","","REG_SZ","Foxit Reader")RegWrite("HKCR\CLSID\{14E8BBD8-1D1C-4D56-A4DA-D20B75EB814E}\DefaultExtension","","REG_SZ",".pdf, PDF Files(*.pdf)")RegWrite("HKCR\CLSID\{14E8BBD8-1D1C-4D56-A4DA-D20B75EB814E}\DefaultIcon","","REG_SZ",$AFI_BASE&"\usr\"&$AFI_XXX&"\Foxit.exe,1")RegWrite("HKCR\CLSID\{14E8BBD8-1D1C-4D56-A4DA-D20B75EB814E}\InprocHandler32","","REG_SZ","ole32.dll")RegWrite("HKCR\CLSID\{14E8BBD8-1D1C-4D56-A4DA-D20B75EB814E}\LocalServer32")RegWrite("HKCR\CLSID\{14E8BBD8-1D1C-4D56-A4DA-D20B75EB814E}\ProgID","","REG_SZ","FoxitReader.Document")RegWrite("HKCR\FoxitReader.Document","","REG_SZ","PDF Document")RegWrite("HKCR\FoxitReader.Document","BrowseInPlace","REG_SZ",1)RegWrite("HKCR\FoxitReader.Document\CLSID")RegWrite("HKCR\FoxitReader.Document\DefaultIcon","","REG_SZ",$AFI_BASE&"\usr\"&$AFI_XXX&"\Foxit.exe,1")RegWrite("HKCR\FoxitReader.Document\protocol\StdFileEditing\server")RegWrite("HKCR\FoxitReader.Document\protocol\StdFileEditing\server")RegWrite("HKCR\FoxitReader.Document\shell\open\command","","REG_SZ",'"'&$AFI_BASE&'\usr\'&$AFI_XXX&'\Foxit.exe" "%1"')RegWrite("HKCR\MIME\Database\Content Type\application/pdf","CLSID","REG_SZ","{14E8BBD8-1D1C-4D56-A4DA-D20B75EB814E}")RegWrite("HKCR\MIME\Database\Content Type\application/pdf","Extension","REG_SZ",".pdf")RegWrite("HKU\.Default\Software\Foxit Software\Foxit Reader\MainFrame","ShowEditorAd_908","REG_SZ",0)RegWrite("HKU\.Default\Software\Foxit Software\Foxit Reader\MainFrame","ShowReaderAd_908","REG_SZ",0)RegWrite("HKU\.Default\Software\Foxit Software\Foxit Reader\MainFrame","ShowTypewriterAd_908","REG_SZ",0)RegWrite("HKU\.Default\Software\Foxit Software\Foxit Reader\MainFrame","ShowPOAd_908","REG_SZ",0)RegWrite("HKU\.Default\Software\Foxit Software\Foxit Reader\MainFrame","ShowSDKAd_908","REG_SZ",0)RegWrite("HKCU\Software\Foxit Software\Foxit Reader\MainFrame","ShowEditorAd_908","REG_SZ",0)RegWrite("HKCU\Software\Foxit Software\Foxit Reader\MainFrame","ShowReaderAd_908","REG_SZ",0)RegWrite("HKCU\Software\Foxit Software\Foxit Reader\MainFrame","ShowTypewriterAd_908","REG_SZ",0)RegWrite("HKCU\Software\Foxit Software\Foxit Reader\MainFrame","ShowPOAd_908","REG_SZ",0)RegWrite("HKCU\Software\Foxit Software\Foxit Reader\MainFrame","ShowSDKAd_908","REG_SZ",0)You can't just use this one since I have my custom network paths, but you should be able to hack it.Oh, and there are some extra settings in there that disable the little pink ad bar. Since it's not changing anything I think it would be okay, but if a mod doesn't think it's cool I'll change it if they want me to.And yes, there are duplicates in there...some apply to the current user, and others to the default user profile. I do this because I don't run these installs during the unattended, but under a 'special' user I make for these tasks. Because of that the 'special' users profile is already created so it won't pull the reg settings from the default profile.Good luck!
mazin Posted August 23, 2006 Posted August 23, 2006 Easier, yet:%SystemRoot%\PDFread.exe -RegisterNo need to regs, unless for tweaking.
gyrene2083 Posted October 2, 2006 Posted October 2, 2006 (edited) Mazin, I was wondering how would I put that in the RunOnceEx.cmd file?Is it like this?REG ADD %KEY%\005 /VE /D "FoxIt Reader" /fREG ADD %KEY%\005 /V 1 /D "%SystemDrive%\foxit.exe" /GROUP="1-Applications" /fREG ADD %KEY%\050 /V 2 /D "REGEDIT /S %systemdrive%\Foxit.reg" /fFoxit.reg, being the code you provided for the application, stored in the %SystemDrive%? Oh and one more thing, what the h3ck, is the /f switch stand for? Edited October 2, 2006 by gyrene2083
mazin Posted October 2, 2006 Posted October 2, 2006 (edited) Foxit Reader 2.0 for Windows is out (Sep 12, 2006).Check their site at www.foxitsoftware.com!I suggest you download the ZIP Package (zip) not the Installer (exe).Unzip the downloaded archive (foxitreader.zip) and put theextracted "FoxitReader.exe" in: $OEM$\$$\ in your UACD!When you set up Windows, the directory is translated toX:\Windows, where X is your System Drive.Hence, the path to your app will be X:\Windows\FoxitReader.exe!Being in Windows directory, your system KNOWS where to find it.And since your Install directory will be deleted in the end,I'd suggest you put "Foxit.reg" in $OEM$\$1\Install\; this will betranslated to X:\Install.Hence, the path to your reg file will be X:\Install\Foxit.reg!Be careful: if file name in X:\Windows is FoxitReader.exe,you must keep the same name in your Foxit.reg.In my reg file, I name it PDFread.exe because I renamedmy file in $OEM$\$$ to PDFread.exe!Now that everything is supposed to be done well, add these lines toyour RunOnceEx.cmd:REG ADD %KEY%\050 /VE /D "FoxIt Reader 2.0 - Tweaking and Registering" /fREG ADD %KEY%\050 /V 1 /D "REGEDIT /S %SystemDrive%\Install\Foxit.reg" /fThat's it!Ah, the /f switch?Being used with REG ADD, it's actually useless!Sometimes, it's harmful, too.I said that long ago.It's function is to force overwriting strings in the Registry, if any.However, I'm always using it with REG DELETE.OFF TOPIC: /GROUP switch is used with INNO installers ONLY! Edited October 2, 2006 by mazin
kof94 Posted October 3, 2006 Posted October 3, 2006 (edited) **Deleted** Edited October 3, 2006 by kof94
gyrene2083 Posted October 3, 2006 Posted October 3, 2006 I'm not familiar on how to make the script run, as I'm not familiar with AUTOIT. How can I implement that in the RunOnceEx.cmd file?Also, I had two off topic questions.First question, I have a few programs that are NULLSOFT packaged. I found this out using the Installer Tools. When I right clicked the executible this is what I got.Nullsoft ® Installersetup.exe /Option(All switches MUST be upper case. No double quotes)Install Options /D=x:\dirname Install program to path. /NCRC Skip CRC check.Display Options /S Silent mode.CMenu Options AutoIt Usage Create the Au3 template script. Edit any variables at the start of the script, and add shortcuts, that require deletion. Refer to the CMenu Help Guide. It displays sample highlighted items, to edit. Compile the script, into an exe, and keep it with the installer. Run the compiled exe, to install. Command line Usage To silently install, use the switch: Setup.exe /SI tried it with the /S switch, and I still had to interact with the prog to install it. I also, tired the /D=x:\dirname, and that didn't work at all. Then I saw the CMenu options for AutoIt. How can I make the script to make this prog run? (I did read the help me file, but it wasn't helpful to me).Second question, I also checked the TweakUI and this is what I got back;InstallShield 2003 ® Installersetup.exe /OptionInstall Options /a Add following parameters to the archived msi. /v Parameters used after this, are passed to the *.msi inside a package.Display Options /s Silent install *.exe packaged. /qn Silent install *.msi. /qb Silent install *.msi with progress window.User Options AutoIt Usage Create the Au3 template script. Edit any variables at the start of the script, and add shortcuts, that require deletion. Refer to the CMenu Help Guide. It displays sample highlighted items, to edit. Compile the script, into an exe, and keep it with the installer. Run the compiled exe, to install. ; If extraction chosen, then run Identity Installer again, when complete. Command line Usage To silently install, use: setup.exe /s /v"/qn" To silently install, if installer extracted, then use: setup.msi /qnI tried all the switches in there and I still didn't get it to install, any ideas on how I can make this work? I would greatly appreciate any help.
kof94 Posted October 3, 2006 Posted October 3, 2006 (edited) Check out AutoIt here.Its's very usefull when installers don't have silent switches (and more).I'd suggest anyone seriously into unattended installations to get used to using it, your gonna need it sooner or later.Anyway this is what you need to do:- Install AutoIt- Redownload my Foxit.au3 from this post- Download foxitreader_setup.exe.- Put my Foxit.au3 and foxitreader_setup.exe in the same dir- Right click Foxit.au3 and click "Compile"Your done. Now you have an AutoIt wrapped installer. Edited October 3, 2006 by kof94
rado354 Posted October 3, 2006 Posted October 3, 2006 (edited) Here is an addon for Foxit Reader 2.0 made with AutoIt script:http://www.msfn.org/board/index.php?showtopic=83618You can decompile it and check how it works Edited October 3, 2006 by rado354
gyrene2083 Posted October 3, 2006 Posted October 3, 2006 I compiled the file. So, I'm guessing I have to put it in my Runonceex.cmd file like this?REG ADD %KEY%\005 /VE /D "FoxIt Reader 2.0" /fREG ADD %KEY%\005 /V 1 /D "%CDROM%\install\apps\FoxIt\FoxIt.exe" /f
kof94 Posted October 3, 2006 Posted October 3, 2006 (edited) @gyrene2083You got it!@rado354Didn't meen to be treadin' you buddy Edited October 3, 2006 by kof94
gyrene2083 Posted October 3, 2006 Posted October 3, 2006 SWEET, and I went to that AutoIt site and it suggested "Windows Admin Scripting Little Black Book". They posted the second edition. But, I looked through my own library, because the black book part rang a bell, and viola I have the first edition. Don't remember why I got it, but I have it. So, that should be a good place to start, right? I also, have a couple of VB books too. Come, to think of it, how the h3ll did I get these books? Sorry, thinking aloud!lol
kof94 Posted October 4, 2006 Posted October 4, 2006 You geek .I just messed with other peoples scripts and read the manual!Oh, and I do cheat abit by using a script generator first and then tidy it up and add features.I think you'll be the one dishing out the advice soon.Happy scripting.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now