Jump to content


tsdsr

Detection Method - Custom Script

Recommended Posts

Hi,

 

I'm having issue using custom detection scripts. More specifically how to exit the detection script to say detected or not.

 

My application is a script that will delete two desktop icons.

 

My detection script checks if and icon exists and if it does increment a count. If the count is 0 that is no icons exist then I want to exit the script and have the application detected as installed.

 

This is what I ran with ...

 

Set objFSO = CreateObject("Scripting.FileSystemObject")

File1="C:\Users\Public\Desktop\HP TRIM Desktop.lnk"

File2="C:\Users\Public\Desktop\HP TRIM Queue Processor.lnk"

Dim count

count = 0

If objFSO.FileExists(File1) then

count= count + 1

End If

If objFSO.FileExists(File2) then

count = count + 1

End If

If count = 0 then

WScript.Quit(0)

End If

 

The logs showed the application not detected so ran my Script correctly. Then when it checked after the install it still showed as undetected.

 

Can anyone explain how I can exist my scripts correctly to show presence of an application?

 

Cheers,

Share this post


Link to post
Share on other sites

Hi Peter,

 

Not sure if I explained myself correctly. I basically have an installation to run (HP TRIM) this installation which puts three desktop icons to C:\Users\Public\Desktop. Two icons are not needed so I need to remove these.

 

For the HP TRIM deployment method I use the msi detection that works no problem. Two remove the icons I have a script to delete them which I have made into a second deployment type. I can't use a built in file detection as I want to run my script if the icons are there (therefore run script to delete them) but if the files are detected the deployment method is says it is installed and the script won't run to delete the icons. Basically I think I need a big NOT in front of the file detection.

 

So I tried to to a custom detection script above which I'm not sure how to exit out for detection.

 

I suppose a work around would be to wrap the TRIM msi and then my file delections in one script, do a manual deployment type and just check for TRIM installed. This doesn't seem to be how things are meant to be done though. I really need some sort of post installation task.

 

Cheers,

Share this post


Link to post
Share on other sites

When it's just about two shortcuts that are not needed then in case you still need to deploy the app I would solve it with a customization file (mst) for the msi and in case it's already deployed I would make one script that detects and deletes. Sample:

If oFSO.FileExists(File1) Then
oFSO.DeleteFile File1
End If

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.