script not working
Hi, we are trying to run below script. At the time of installation, before install finalize, but it is not working.
Please guide.
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
Answers (5)
Please log in to answer
Posted by:
WSPPackager
14 years ago
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
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
Posted by:
pjgeutjens
14 years ago
Posted by:
anonymous_9363
14 years ago
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.
Posted by:
Packagingteam
14 years ago
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.
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.
Posted by:
pjgeutjens
14 years ago
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
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.