Snapins again
-
Hello,
my conf:
fog subversion 7931
I’m trying run bat script via fog to install MS office.
Here is snapin config:
Here is script:mkdir c:\office2016 %systemroot%\system32\xcopy \\upow-8.intranet\public\Office2016_PL_32B\ c:\office2016 /y /d /e /c /i /f /h /k /v /s cd c:\office2016 setup.exe /adminfile Unattended.msp
Folder c:\office2016 is created by script, but nothing else.
I receive in fog.log this error:---------------------------------SnapinClient--------------------------------- ------------------------------------------------------------------------------ 30.05.2016 15:04 Client-Info Client Version: 0.10.6 30.05.2016 15:04 Client-Info Client OS: Windows 30.05.2016 15:04 Client-Info Server Version: 7931 30.05.2016 15:04 Middleware::Response Success 30.05.2016 15:04 SnapinClient Snapin Found: 30.05.2016 15:04 SnapinClient ID: 918 30.05.2016 15:04 SnapinClient RunWith: cmd.exe 30.05.2016 15:04 SnapinClient RunWithArgs: /c 30.05.2016 15:04 SnapinClient Name: Office 2016_32_PL_cmd 30.05.2016 15:04 SnapinClient File: office2016_pl_32x.bat 30.05.2016 15:04 SnapinClient Created: 2016-05-30 13:04:16 30.05.2016 15:04 SnapinClient Args: 30.05.2016 15:04 SnapinClient Action: 30.05.2016 15:04 Middleware::Communication Download: http://fog-server/fog/service/snapins.file.php?mac=D0:17:C2:93:BB:2F||00:00:00:00:00:00:00:E0|00:00:00:00:00:00:00:E0&taskid=918 30.05.2016 15:04 SnapinClient C:\Program Files (x86)\FOG\tmp\office2016_pl_32x.bat 30.05.2016 15:04 Bus { "self": true, "channel": "Notification", "data": "{\r\n \"title\": \"Installing Office 2016_32_PL_cmd\",\r\n \"message\": \"Please do not shutdown until this is completed\",\r\n \"subjectID\": \"snapin-Office 2016_32_PL_cmd\"\r\n}" } 30.05.2016 15:04 Bus Emmiting message on channel: Notification 30.05.2016 15:04 SnapinClient Starting snapin... 30.05.2016 15:04 SnapinClient Snapin finished 30.05.2016 15:04 SnapinClient Return Code: 1 30.05.2016 15:04 Bus { "self": true, "channel": "Notification", "data": "{\r\n \"title\": \"Office 2016_32_PL_cmd Installed\",\r\n \"message\": \"Installation has finished and is now ready for use\",\r\n \"subjectID\": \"snapin-Office 2016_32_PL_cmd\"\r\n}" } 30.05.2016 15:04 Bus Emmiting message on channel: Notification 30.05.2016 15:04 Middleware::Communication URL: http://fog-server/fog/service/snapins.checkin.php?taskid=918&exitcode=1&mac=D0:17:C2:93:BB:2F||00:00:00:00:00:00:00:E0|00:00:00:00:00:00:00:E0&newService&json
Some time ago I submitted this problem, but then this script worked out.
Any help, suggestions appreciated.
Regards -
Does the script work manually?
Might want to try start /wait instead of cmd /c
-
said in Snapins again:
\upow-8.intranet\public\Office2016_PL_32B\
is this share readable by everyone and not only every authenticated user?
If this is a domain computer you have to be authenticated else it won’t work.Try to open that share while you are logged in with a local user (not domain authenticated) and try to run the script manually.
Why do you copy whole installation directory to the destination to install? Why not running directly via network, it’s time wasting to copy
infront. For example:\\upow-8.intranet\public\Office2016_PL_32B\setup.exe /adminfile \\upow-8.intranet\public\Office2016_PL_32B\Unattended.msp
Regards X23
-
As I’ve said before, I’m fairly sure batch scripts don’t work nicely on UNC paths. You can use batch to map a unc path but running filea directly from unc always seems hit or miss. While you can do it manually, sometimes, scripts don’t seem to like doing it.
-
@Tom-Elliott I’ve never had issues copying files straight from UNC paths though, although I use copy /y instead of xcopy most of the time so results may vary.
-
@Quazz I didn’t pay close enough attention and didn’t see the xcopy of the file. That said maybe the OP can try using copy /y vs. xcopy?
-
@Tom-Elliott Also, adding the backslash to the targetpath is sometimes necessary, I seem to recall copy commands asking if it’s a file or directory when that’s not specified, lol.
-
@Quazz
Yes script run manually work.
With /wait instead /c task stuck. -
@robza Start /wait , not cmd /wait?
-
@x23piracy
This share is readable for everyone. It is no domain computer (it is linux with samba).
Script run manualy works perfectly.
Running snapin with this content:\\upow-8.intranet\public\Office2016_PL_32B\setup.exe /adminfile \\upow-8.intranet\public\Office2016_PL_32B\Unattended.msp
in fog.log got this:
---------------------------------SnapinClient--------------------------------- ------------------------------------------------------------------------------ 30.05.2016 21:41 Client-Info Client Version: 0.10.6 30.05.2016 21:41 Client-Info Client OS: Windows 30.05.2016 21:41 Client-Info Server Version: 7931 30.05.2016 21:41 Middleware::Response Success 30.05.2016 21:41 SnapinClient Snapin Found: 30.05.2016 21:41 SnapinClient ID: 922 30.05.2016 21:41 SnapinClient RunWith: cmd.exe 30.05.2016 21:41 SnapinClient RunWithArgs: /C 30.05.2016 21:41 SnapinClient Name: Office 2016_32_PL_cmd 30.05.2016 21:41 SnapinClient File: office2016_pl_32.cmd 30.05.2016 21:41 SnapinClient Created: 2016-05-30 19:41:25 30.05.2016 21:41 SnapinClient Args: 30.05.2016 21:41 SnapinClient Action: 30.05.2016 21:41 Middleware::Communication Download: http://fog-server/fog/service/snapins.file.php?mac=D0:17:C2:93:BB:2F||00:00:00:00:00:00:00:E0|00:00:00:00:00:00:00:E0&taskid=922 30.05.2016 21:41 SnapinClient C:\Program Files (x86)\FOG\tmp\office2016_pl_32.cmd 30.05.2016 21:41 Bus { "self": true, "channel": "Notification", "data": "{\r\n \"title\": \"Installing Office 2016_32_PL_cmd\",\r\n \"message\": \"Please do not shutdown until this is completed\",\r\n \"subjectID\": \"snapin-Office 2016_32_PL_cmd\"\r\n}" } 30.05.2016 21:41 Bus Emmiting message on channel: Notification 30.05.2016 21:41 SnapinClient Starting snapin... 30.05.2016 21:41 SnapinClient Snapin finished 30.05.2016 21:41 SnapinClient Return Code: 1 30.05.2016 21:41 Bus { "self": true, "channel": "Notification", "data": "{\r\n \"title\": \"Office 2016_32_PL_cmd Installed\",\r\n \"message\": \"Installation has finished and is now ready for use\",\r\n \"subjectID\": \"snapin-Office 2016_32_PL_cmd\"\r\n}" } 30.05.2016 21:41 Bus Emmiting message on channel: Notification 30.05.2016 21:41 Middleware::Communication URL: http://fog-server/fog/service/snapins.checkin.php?taskid=922&exitcode=1&mac=D0:17:C2:93:BB:2F||00:00:00:00:00:00:00:E0|00:00:00:00:00:00:00:E0&newService&json
Nothing happend.
-
@Quazz
With start /wait got this in log:31.05.2016 08:31 Client-Info Client Version: 0.10.6 31.05.2016 08:31 Client-Info Client OS: Windows 31.05.2016 08:31 Client-Info Server Version: 7931 31.05.2016 08:31 Middleware::Response Success 31.05.2016 08:31 SnapinClient Snapin Found: 31.05.2016 08:31 SnapinClient ID: 929 31.05.2016 08:31 SnapinClient RunWith: start 31.05.2016 08:31 SnapinClient RunWithArgs: /wait 31.05.2016 08:31 SnapinClient Name: Office 2016_32_PL_cmd 31.05.2016 08:31 SnapinClient File: office2016_pl_32_z.bat 31.05.2016 08:31 SnapinClient Created: 2016-05-31 06:31:02 31.05.2016 08:31 SnapinClient Args: 31.05.2016 08:31 SnapinClient Action: 31.05.2016 08:31 Middleware::Communication Download: http://fog-server/fog/service/snapins.file.php?mac=D0:17:C2:93:BB:2F||00:00:00:00:00:00:00:E0|00:00:00:00:00:00:00:E0&taskid=929 31.05.2016 08:31 SnapinClient C:\Program Files (x86)\FOG\tmp\office2016_pl_32_z.bat 31.05.2016 08:31 Bus { "self": true, "channel": "Notification", "data": "{\r\n \"title\": \"Installing Office 2016_32_PL_cmd\",\r\n \"message\": \"Please do not shutdown until this is completed\",\r\n \"subjectID\": \"snapin-Office 2016_32_PL_cmd\"\r\n}" } 31.05.2016 08:31 Bus Emmiting message on channel: Notification 31.05.2016 08:31 SnapinClient Starting snapin... 31.05.2016 08:31 SnapinClient ERROR: Could not start snapin 31.05.2016 08:31 SnapinClient ERROR: Unable to find file 31.05.2016 08:31 Middleware::Communication URL: http://fog-server/fog/service/snapins.checkin.php?taskid=929&exitcode=-1&mac=D0:17:C2:93:BB:2F||00:00:00:00:00:00:00:E0|00:00:00:00:00:00:00:E0&newService&json ------------------------------------------------------------------------------
-
xcopy supports UNC paths. Ever since I found that out, I stopped doing mapped drives in scripts.
-
@robza and @Wayne-Workman, just thinking out here. So we know the script runs flawlessly manually. Sorry if this is a silly question, but which user do you run it as? I believe the snapins run as SYSTEM (i think, correct me if I’m wrong). Could this have anything to do with the discrepancy we are seeing?
-
@fry_p They do run as the
SYSTEM
user. One thing to do is redirect output to a log file for every line. Then you will be able to see where it fails.