Managed Install not running all VBS syntax
I have a zip file i have uploaded to the k1000 associated with my software. Inside the zip is the VBscript, the MSI, and a dll. In my VBscript i have the install of the MSI and then copying the DLL to certain folder.
This all works fine and dandy running it locally, but when you do it through kace, the MSI installs great, but the DLL does not copy to the directory specified in the VBscript. I've tested this with many different installs i have and it's just not going through my whole script.
To add, when i go to Program Data\Kace\Installs, i can run the VBscript in there that Kace as put there and it works great too.
When you launch a vbscript manually on a 64bit machine, it will normally be launched using wscript.exe from the System32 directory. The KACE agent runs as 32bit process and therefore launches wscript.exe as a 32bit process from SysWOW64.
As you probably are aware, when your script runs as 32bit, the environment will be much different. The OS will alias HKLM\Software\Wow6432Node as HKLM\Software... C:\Program Files (x86) as C:\Program Files... and your DLL/COM objects will likely be inaccessible.
You can troubleshoot by launching the script manually as a 32bit process. Manually launch a CMD prompt by specifying the full path to the 32bit cmd.exe (c:\windows\SysWOW64\cmd.exe). In that CMD window, type the path to your script. Or just launch your script like --> c:\windows\SysWOW64\wscript.exe <your script path>
One thing I've had to do a few times is to have the script check if it is running as a 32bit process and if so, relaunch itself as 64bit.
Here's a sample:
Set WshShell = CreateObject("Wscript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") If fso.FileExists("c:\windows\sysnative\cscript.exe") Then '32 on 64...relaunch msgbox "I'm 32bit...relaunching" WshShell.run "c:\windows\sysnative\cscript.exe //nologo " & Chr(34) & wscript.scriptfullname & Chr(34),,True Wscript.quit Else msgbox "I'm 64bit!" End If