Script not working in stubpath
Hi,
I am trying to run below vbscript through stubpath:
Windows Registry Editor Version 5.00
But it is not working. It is opening "c:\programfiles\mozilla", which is not expected behaviour. After login if i run it manually then it is working fine.
I am trying to run below vbscript through stubpath:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\mozilla firefox add-ons]
"Version"="1.0.0"
"StubPath"="C:\\Program Files\\mozilla firefox add-ons\\update.vbs"
Dim oFSO, oFolder, oSubFolder, i
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set objshell = Createobject("wscript.shell")
struserprofile = objshell.expandenvironmentstrings("%userprofile%")
strpath1 = struserprofile & "\Application Data\Mozilla\Firefox\Profiles"
strCurrentDir = oFSO.GetParentFolderName(WScript.ScriptFullName)
Const OVERWRITE_EXISTING = True
if ofso.folderexists(strpath1) then
Set oFolder = oFSO.GetFolder(struserprofile & "\Application Data\Mozilla\Firefox\Profiles")
Set oSubFolder = oFolder.SubFolders
Else
WScript.Quit
End if
For each i in oSubFolder
Path = struserprofile & "\Application Data\Mozilla\Firefox\Profiles\" & i.name
Next
strpath2 = path & "\extensions"
strpath3 = strpath2 & "\{b749fc7c-e949-447f-926c-3f4eed6accfe}"
strpath4 = strpath2 & "\{c4dc572a-3295-40eb-b30f-b54aa4cdc4b7}"
strpath5 = strpath2 & "\{8ea9957e-2953-402f-80e0-bceb5f169d6f}"
strfrom1 = strCurrentDir & "\{b749fc7c-e949-447f-926c-3f4eed6accfe}"
strto1 = strpath2 & "\{b749fc7c-e949-447f-926c-3f4eed6accfe}"
strfrom2 = strCurrentDir & "\{c4dc572a-3295-40eb-b30f-b54aa4cdc4b7}"
strto2 = strpath2 & "\{c4dc572a-3295-40eb-b30f-b54aa4cdc4b7}"
strfrom3 = strCurrentDir & "\{8ea9957e-2953-402f-80e0-bceb5f169d6f}"
strto3 = strpath2 & "\{8ea9957e-2953-402f-80e0-bceb5f169d6f}"
if ofso.folderexists(strpath3) = 0 then
oFSO.Copyfolder strfrom1, strto1, OVERWRITE_EXISTING
end if
if ofso.folderexists(strpath4) = 0 then
oFSO.Copyfolder strfrom2, strto2, OVERWRITE_EXISTING
end if
if ofso.folderexists(strpath5) = 0 then
oFSO.Copyfolder strfrom3, strto3, OVERWRITE_EXISTING
end if
But it is not working. It is opening "c:\programfiles\mozilla", which is not expected behaviour. After login if i run it manually then it is working fine.
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
PackageExpert
13 years ago
Posted by:
anonymous_9363
13 years ago
If you're including this in your package, you could always make Windows/Windows Installer work for you, of course, by changing the registry value to use the relevant directory property.
Let's say there's a property called 'add-ons'. Make the entry read
Let's say there's a property called 'add-ons'. Make the entry read
Cscript.exe //B //NOLOGO "[add-ons]update.vbs"
Now you have catered for installations where the user chooses to install programs to, say, E:\Apps, as well as obviated any issues with paths with spaces in their names.

so that the conversation will remain readable.