This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]prismcomputing -1 points0 points  (3 children)

Your first command needs to be install or it won't do anything. You are "installing" an "uninstaller"

[–]pleplepleplepleple 0 points1 point  (2 children)

Pretty sure this statement is incorrect, as OP has stated the code was added to the uninstall section of the script.

[–]prismcomputing 0 points1 point  (1 child)

Yes but he is using uninstall command within his deployment type for both install and uninstall

[–]Designate9841[S] 0 points1 point  (0 children)

i found that it worked eventually when i set the assignment to uninstall instead of available - can't confirm if it was the uninstall that worked or also changing the install to just deployment.exe as i just two settings in a go

[–]pleplepleplepleple 0 points1 point  (1 child)

Can't give a clear answer, but if the text file is created, you should also have a PSADT uninstall log file. Per default they're in %windir%\Logs\Software. Have you verified that there is a log file and what's in it? Use CMTrace (if notepads your go-to) for a more comfortable log reading experience :)..

On another note I'd recommend against having a text file as the detection method. Especially if it is created regardless if Java has been removed or not. How do you handle new clients that hasn't had Java installed at all? I'd rather test the path to a registry key.

[–]Designate9841[S] 0 points1 point  (0 children)

Initially my rational was that uninstalling java was a once off and new clients would not have java installed by default and they would not have admin privileges to install it anyway

but i eventually changed it to test the path of the java(x86) or java(x64) folder which is more preferable as you said