powered by Jive Software

Trying to use GPO to install Spark

I am fairly new to GPO and using it to install applications. I have been tasked to set up a GPO that will install spark on PCs in the company and I am trying to do this silently so there is no user interaction during the install. I have used several online suggestions to set this up but still cannot get the MSI to install the application. Any ideas

1 Like

There is no official MSI package and building your own from exe probably brakes something. I’m not using Software Installation part of GPO for Spark. I have a cmd script which kills Spark if it is running and runs its setup’s exe with -q switch. This cmd is in the Computer > Scripts > Shutdown. So it runs only when user turns off his PC. It takes a bit longer to shutdown, but that’s ok. I’m using kill command to be sure nothing will interfere, because Spark may take longer to shut off. Full script is like this:

IF EXIST “C:\Program Files\Spark\spark_2_6_3_598.txt” GOTO END

taskkill /F /IM Spark.exe
\servershare\spark_2_6_3_598.exe -q
del "C:\Program Files\Spark*.txt"
copy \servershare\spark_2_6_3_598.txt “C:\Program Files\Spark”

:END

I’m also copying txt file with a version number in its name, because there is no other reliable way to check which version is already installed

wroot,

Thanks for the reply I will give that a shot. hope it works as I have about 1 week to get this working.

Btw, this is my upgrade script actually. The script for the first install was much shorter, without any checks But this one should work anyway. When a new version appears, i just put a new txt and setup file on the share and edit this script and enable GPO to PCs.

Using this version currently:

http://bamboo.igniterealtime.org/artifact/SPARK-INSTALL4J/shared/build-668/Insta ll4j/spark_2_7_0_668.exe

Here is my version of an install/login script that uses Kixtart. I do the same check for upgrading via a text file ( 2_7_0_spark.SAM ). When a new version comes out I edit that file name and the path to the exe in the script, and it installs for everyone the next time they start up.

; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-Start Spark INSTALL-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

; Spark install

function install_spark()

shell “taskkill /f /im Spark.exe”

DEL “%appdata%\Spark*spark.SAM”

run "\tjs1\deploy\Spark\spark_2_7_0.exe -q -overwrite <—Silent "

if NOT Exist ("%appdata%\Spark\spark.properties")

MD “%appdata%\Spark”

COPY “\tjs1\deploy\Spark\spark.properties” “%appdata%\Spark”

endif

COPY “\tjs1\deploy\Spark*spark.SAM” “%appdata%\Spark”

?"[Spark Installed or Upgraded]"

endfunction

$CurrentSpark = Dir("\tjs1\deploy\Spark*spark.SAM")

$SparkAppData = “%appdata%\Spark”

if @OnWow64

if NOT Exist ( “C:\Program Files (x86)\Spark\Spark.exe” ) OR NOT Exist ( “%appdata%\Spark” + $CurrentSpark )

? “64bit”

install_spark()

endif

Else

if NOT @OnWow64

IF NOT Exist ( “C:\Program Files\Spark\Spark.exe” ) OR NOT Exist ("%appdata%\Spark" + $CurrentSpark )

?“32bit”

install_spark()

endif

endif

endif

; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-_ End Spark _-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

I am too trying to deploy the newest version of Spark (2.7.0) via GPO but am having mixed results even with the batch, kindly, posted above.

2 questions:

  • Will there ever be an MSI file?

  • -overwrite , ive never seen this switch. what does it do?

Thanks,

  • Will there ever be an MSI file?

Doubt it. I haven’t found an information if install4j (which is used to produce installers) is able to produce MSI. Spark had MSI installer in the past, but it was very bad, so it has been removed.

  • -overwrite , ive never seen this switch. what does it do?

from the install4j help: install4j help

Only valid if -q is set. In the unattended installation mode, the installer will not overwrite files where the overwrite policy would require it to ask the user. If -overwrite is set, all such files will be overwritten.

I guess you can create an install4j installer and set that some files shouldn’t be overwritten during the update and this option overrides this. I haven’t used this. When you manually run Spark installer ir defaults to updating the installation, i guess that -q mode does the same. At least i haven’t had any problems with updating Spark this way.

Can you explain what does “mixed results” mean? It doesn’t update or do you have problems with Spark after doing such update?

Thanks for your reply and explanations!

By mixed results i meant that some machines on the network successfully upgrade previous Spark installation and others (appears to be most) do not. I am trying to identify the pattern and cause.

My GPO (Machine level) executes below batch on StartUp.

IF EXIST “c:\Program Files (x86)\Spark\spark_ver_2.7.0.txt” GOTO END

REM taskkill /F /IM Spark.exe

start /wait \server\Software\Spark\spark_2_7_0.exe -q

xcopy “\server\Software\Spark\version*.*” “c:\Program Files (x86)\Spark” /Y

REM above line copies spark_ver_2.7.0.txt to c:\Program Files (x86)\Spark\

:END

The interesting thing here is that the machines that fail to install the spark upgrade (by the way, there are no errors in the application logs) have the spark_ver_2.7.0.txt file under c:\Program Files (x86)\Spark\ anyways! This indicates some sort of malfunction during the installation of the new spark?

I will give -overwrite a try, perhaps it’ll do the trick.

Have you tried running it without the “start /wait”? You can try running your script on such a machine in a cmd window (with admin rights) and checking how it goes. That’s how i tested my script. Not exactly the same as Startup script, but maybe it will show something.

Another thing might be that you are updating older (2.6.3) Spark with a new one and they are using different versions of installers. Though it works fine manually. But i have started with early builds of 2.7.0 in my network. Never had 2.6.3 before.

Thank you.

I will try without start /wait.

I am indeed trying to upgrade the older 2.6.3.

Here is the info on the -overwrite:

install4j help

“Only valid if -q is set. In the unattended installation mode, the installer will not overwrite files where the overwrite policy would require it to ask the user. If -overwrite is set, all such files will be overwritten.”

I seemed to need this for force an upgrade from my 2.6.3 installs. Otherwise it looked like I might have to use a response file. I’ll have a better idea if it worked correctly tomorrow, but looked good in testing.

There is another idea behind failing 2.6.3 > 2.7.0 updates. Though no solution so far. Other than maybe somehow uninstalling 2.6.3 automatically before installing 2.7.0. Spark 2.7.0 install via Windows Startup Script…

I know I’m a little late to the game, but WPKG is an opensource software distribution software and there already is a package written for Spark - http://wpkg.org/spark

I just updated the package for Spark 2.7.0. You can also trigger the package deployment via GPO. It takes a little bit of leg working configuring, but well worth the effort. Logs and pre-built deployment packages rock.

My 2 cents

-Justin

2 Likes

Alright, a small update.

I am yet to confirm on a few more stations but it appears that the -overwrite switch is the key. Several machines that failed to update before, picked and installed the 2.7.0 version over the 2.6.3.

Also, the uninstall method sounds like a good one except I cannot find the uninstall guid in the registry for 2.6.3 (HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Unins tall)

*EDIT: looking at Justin Bennett’s reply and Spark - WPKG | Open Source Software Deployment and Distribution link, it seems that perhaps just running

“%PROGRAMFILES%\Spark\uninstall.exe” -q in a batch will do the trick, if one prefers the uninstall method.

Excellent, thanks for the idea. I deploy many other software, patches, service packs for various applications. Perhaps this will be a better alternative to me creating custom batch scripts.

Yes. I resolved that. Its a little bit tricky, but it worths.

You need a Windows XP virtual machine, totally cleaned, or recently installed with NO EXTRA SOFTWARE OR BROWSERS RUNNING

then, you need to install there the “AppDeploy Repackager” (check the state of PC before and after a installation to make MSI packages)

run it and get the software prepared (i guess you will make that posible. if it doesnt google it, its easy tu use.)

install spark normally (2.6 in my case, because 2.7 was released a few weeks ago)

tune the .JAR files locat in the installation folder, just if you need to customize it

go again to “app deploy” software, select the spark folder, and the registry files assosiated and just make your MSI !!!

my msi is now installed on windows xp 32bits machines, and 8.1 64bits machines with no problems.

i cant give you my MSI because its customized for my company.

hope this help. sorry 4 my english, im hurry haha

greetings from Argentina.

did the solution from wroot work? I’m needing to do the same thing

Rather than waiting for a reply from a person who hasn’t been here for 5 months, you can actually try it yourself.

I have created a very similar script as wroot, doing a check for fileversion.txt then running the installer in -q mode if it doesn’t exist. This has worked well on my local machine but I am an admin. I am wanting to use a GPO to run my little batch file at say login. I think it would run the installer but won’t have permission to copy the new .txt file…which also means I can’t copy the spark properties from appdata. Is there a way to get the batch to run as an administrator or domain admin using Group Policy? Or even run CMD.exe as admin then call the batch file and execute…just has to be a clean way to run the file as admin when most users logging in will not be administrators.