VBScript Custom Action 38 GetParentFolderName Will Not Resolve
I dare say this can be done more simply and/or more elegantly and/or even better than what I have thrown together here, but we all start somewhere right?
This is my situation:
I have 3 different files, that need to be copied to 3 different folders. I'm using a transform on the Firefox ESR MSI, which will be installed via ConfigMgr. Previously when running other *.BAT or *.CMD files I've used '%~dp0' to resolve the path, but I can't use that with a CA 38! I know I don't have to, but I would like to try and use a MSI in my ConfigMgr Deployment Type rather than a BAT/CMD file. I started by trying to run 3 separate CA FileCopies, but ran into CA Target length limits. Then I thought to use my CA to call a CMD file which has the 3 FileCopy commands in it and so now, this is my CA Target:
dim filesys, DIR : Set filesys = CreateObject("Scripting.FileSystemObject") : DIR = filesys.GetParentFolderName("Wscript.ScriptFullName") : Set shell = CreateObject("WScript.Shell") : shell.Run DIR & "\filecopy.cmd"
And this is what my MSI log yells back at me:
MSI (s) (00:1C) [04:43:21:447]: Product: Mozilla Firefox 68.7.0esr x64 en-GB -- Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action CA_CustFileCopy script error -2147024894, : Line 1, Column 193,
Column 193 brings me to:
shell.Run DIR & "\filecopy.cmd"
In it's own *.VBS file, my CA Target above - without quotes around Wscript.ScriptFullName - works a treat and does what I want it to!
I've been running in cirlces for ages now and just don't know what else to try because, well, I just don't know enough.
Would someone mind either helping a noob out or pointing a noob towards some useful resources to read up or both, please?
Thanks in advance,