Using a batch file to run the collection installs

Using a batch file to run the collection installs

Anonymous
Not applicable
2,656 Views
4 Replies
Message 1 of 5

Using a batch file to run the collection installs

Anonymous
Not applicable

Last year I had the thought of trying to make a combined collection installer using a batch file. I plan to try that and want to see if anyone else can poke holes in my thought. 

 

I've declared the server path as a variable, then copied the "target" path out of the deployment shortcut and replaced the relevant path with my variable. Does anyone see an issue with this? 

 

Set Server=\\vault\Autodesk

%Server%\ACAD_2018\Img\Setup.exe /qb /I %Server%\ACAD_2018\Img\ACAD_2018.ini /Trial /language en-us
Accepted solutions (2)
2,657 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Accepted solution

I did figure out how to make this work 

 

What I had to do was a little more involved, and possibly a kluge but here's what I did

 

I did declare the main deployment folder 

 

REM set server name and deployment folder
set Server=\\servername\deployments

 

I then declared the deployment subfolders where the executable and ini files live

 

REM AutoCAD Deployment folder
set ACAD=ACAD_2018\Img 

 

I then used these to run the deployment using Start /d so that it starts in the correct folder(like the shortcut does) 

 

REM Install AutoCAD 2018

start /b /d %Server%\%ACAD% /wait %Server%\%ACAD%\Setup.exe /qb /I %Server%\%ACAD%\ACAD_2018.ini /Trial /language en-us

 

to keep the installers from stomping on each other I then added a loop that checked if setup.exe was running 

 

REM Wait for Setup to Finish
echo off
:loop
tasklist /fi "imagename eq Setup.exe" |find ":" > nul
if errorlevel 1 goto loop 

 

When setup.exe closed, then the batch file could go to the next line.  I had to this, because the deployment downloads the files, and switches from running off the server to %temp% which causes the batch file to proceed to the next installation. 

 

I've included a text file version, just change the variables, and change the file extension to bat. 

0 Likes
Message 3 of 5

DannyNL
Advisor
Advisor

Instead of adding the loop in search of a setup.exe, wouldn't a /W argument added to the setup.exe also solve the issue of processing the next only after the former one has finished?

 

See i.e. this link and scroll down to the part where they add the setup.exe to the PDQ Deploy package.

https://www.pdq.com/blog/silently-deploy-autocad-pdq-deploy/

0 Likes
Message 4 of 5

Anonymous
Not applicable

That may work

 

I may also remove the /wait from the start, since I think in this case it's not doing anything for me. 

 

One thing I'm trying to do is make this run without any additional installations

 

If I were making this for a reseller, I'd likely build a batch to first run robocopy on the deployments I plan to use, that then goes through the INI files, and this installer that replaces the server name. 

0 Likes
Message 5 of 5

Anonymous
Not applicable
Accepted solution

One thing I noticed when running the original script is that I'd get AutoCAD, but Electrical and Mechanical would get skipped. I think what happens is that the loop sees that setup.exe is down, and proceeds, but the installer sees something else running so shuts down and skips to the next line. 

 

What I've done now is added a 60 second timeout after the loop to give the install time to fully shut down. I've also rearranged the sequence and kept the wait option. 

 

REM Install AutoCAD 2018
start /d %Server%\%ACAD% /b /wait %Server%\%ACAD%\Setup.exe /W /qb /I %Server%\%ACAD%\ACAD_2018.ini /language en-us
REM Wait for Setup to Finish
echo off
:loop
tasklist /fi "imagename eq Setup.exe" |find ":" > nul
if errorlevel 1 goto loop

timeout /t 60 /nobreak