Hi, we are trying to run below script. At the time of installation, before install finalize, but it is not working.

Please guide.


on error resume next
Set WshShell = WScript.CreateObject("WScript.Shell")
wshshell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.pdf\","REG_SZ"
wshshell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.pdf\","MiKTeX.sty.2.8","REG_SZ"
wshshell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.pdf\Content Type", "application/pdf", "REG_SZ"
wshshell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.pdf\MiKTeX.sty.2.8\","REG_SZ"
wshshell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.pdf\MiKTeX.sty.2.8\ShellNew\","REG_SZ"

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Hi

Why do you want to use the script? Why dont you add all these registry keys directly in msi?

You can try using WMI. For more detials http://msdn.microsoft.com/en-us/library/aa394600(VS.85).aspx

I would rather use the .reg file with regedit.exe
Answered 04/26/2010 by: WSPPackager
Senior Purple Belt

Please log in to comment
0
Set WshShell = WScript.CreateObject("WScript.Shell")

the WScript part won't work in an MSI. Just delete it


Set WshShell = CreateObject("Wscript.shell")



Why do you want to use the script? Why dont you add all these registry keys directly in msi?


also very true [:D]
Answered 04/26/2010 by: pjgeutjens
Red Belt

Please log in to comment
0
the WScript part won't work in an MSIThat's only true for embedded script. If it's called externally (or extracted from the Binary table), it's fine.

The app is clearly taking over the .PDF extension so perhaps the script is recording which application it's currently assigned to so that that can be reinstated when this app is uninstalled. Right? [oink, flap...]

As to use of script versus the Registry table, the OP should be aware that he/she should build a "sister" CA for uninstallation anyway, if only to remove the association.
Answered 04/26/2010 by: VBScab
Red Belt

Please log in to comment
0
Yes script is being used for the same reason, to install and remove .pdf extension externally, because through msi it is not behaving as expected. Thanks pjgeutjens for figuring out the bug.
Only one thing we are not able to achieve, that is file association with icon. [We are not getting perticular registry] We are working on it.
Answered 04/26/2010 by: Packagingteam
Orange Belt

Please log in to comment
0
Only one thing we are not able to achieve, that is file association with icon. [We are not getting perticular registry] We are working on it.

Might be mistaken here but I think the logic goes like this (I'll use a Word 2007 document as example):

HKCR\.docx\(Default) = Word.Document.12
HKCR\Word.Document.12\Shell\Open\Command\(Default) = "C:\Program Files\Microsoft Office\Office14\WINWORD.EXE" /n "%1"
HKCR\Word.Document.12\DefaultIcon\(default) = blabla path to icon (.ico or .exe,number of contained icon)

so the default for the extension gives you the document type, open-command and icon are then defined in HKCR\<document type>

I'd say give it a whirl, let me know how it works out (I'm at home and don't feel like messing with my word doc associations on this machine [:D])

PJ
Answered 04/26/2010 by: pjgeutjens
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity