Hi,
There is a package already deployed in the company, it's about a plugin to access a bank's website. This package install several files into installation folder, the problem is during unistallation process; there is a file taken by the system so it remains installed on his folder; even after restart the computer.
So far, it never was a problem but now I've received a demand to build another package about a plugin to access a bank's website. This package has a file with the same name and the same location that the file included in the old package, so the new package is not changing this file, because the old one is still there.

So, how can I do to put a CA or something like that, to delete the file before copy the new one?
If you don't understand anything, please let me know and I'll try to explain it better.
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
You could do this with a simple batch file to delete the folder/file and then start the installation of the new software.
Answered 06/27/2011 by: jmaclaurin
Third Degree Blue Belt

Please log in to comment
0
Is it just the file that you mentioned, exists on target machine? OR Is the older version of plugin app still exists in your environment?
In the latter case, (and also as far as best practices are concerned) don't you think package 'Upgrade' is the option here?
Answered 06/27/2011 by: SandeepPanat
Orange Senior Belt

Please log in to comment
0
Hello CMI2000,

If you exactly want to remove the file through custom action means. include the below script to remove the file while uninstalling. and don't forget to give condition REMOVE~=ALL and it should be immediate custom action and you ve to place after InstallFinalise ,in the Execution sequence.

'File deletion Script.. save as File_Delete.vbs
dim filesys
Set filesys = CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("<full path with file name>") Then
filesys.DeleteFile "<full path with file name>"
End If
Answered 06/28/2011 by: kpremchander
Yellow Belt

Please log in to comment
0
Well , why dont you try with Reinstallmode=amus , i think it might work.
Answered 06/28/2011 by: blacklisted_packager
Orange Belt

Please log in to comment
0
Hi,

You can use file deletion script mentioned by K.Premchander but need to sequence before costing with condition Not Installed.

Navnath
Answered 06/28/2011 by: navnathz
Senior Yellow Belt

Please log in to comment
0
Reinstallmode=amus

Will solve ur prob....Add it in property table
Answered 06/28/2011 by: kanthsri87
Senior Yellow Belt

Please log in to comment
0
OK, I'll try to use your script but I can't change the package already deployed, I have to do a new package with the new plugin. It isn't an upgrade because it's about a different bank's website. I'll put this script at the beginning of the install sequence to remove the file before to install the new one.
But... are you sure that this script could delete the file even if it's taken by the system??
Answered 06/28/2011 by: cmi2000
Senior Purple Belt

Please log in to comment
0
I dint get your point 'taken by the system'.

I think during uninstallation of the application some process regarding your application is running behind which uses that file.
Are you installing the new app by uninstalling the old app? If so find that process which is using that file and kill that before deleting the file or the whole folder.

Use these two scripts (killing process and deleting folder) in the new application with condition NOT REMOVE~="ALL"

EDIT:Adding true in vbscript will remove the file or folder forcebully

Eg:- fso.deletefolder(s),True
Answered 06/28/2011 by: naveen.packager
Green Belt

Please log in to comment
0
no, the uninstallation process try to delete the file, but it remains in its location even after restart the system. I can't to install the new package because it has a file with the same name and the same location that the old one, so I have to put something in the new package to delete the old files.
with 'taken by the system' I mean 'the file is being used by a process. The processes that are using this file are explorer.exe and winlogon.exe, so I can't kill these processes. I have to 'unlock' it.
Manually, I've installed a software called unlocker and it can to unlock the file and I can delete it later; but I need to do that through my new package, not manually...
do you understand?
Answered 06/28/2011 by: cmi2000
Senior Purple Belt

Please log in to comment
0
ORIGINAL: naveen.packager
Use these two scripts (killing process and deleting folder) in the new application with condition NOT REMOVE~="ALL"

EDIT:Adding true in vbscript will remove the file or folder forcebully

Eg:- fso.deletefolder(s),True


Where have I to put this condition? I think at the beginning of the install sequence...
You mean
IF NOT REMOVE~="ALL" then
dim filesys
Set filesys = CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("<full path with file name>") Then
filesys.DeleteFile "<full path with file name>", true
End If

????
Answered 06/28/2011 by: cmi2000
Senior Purple Belt

Please log in to comment
0

You mean
IF NOT REMOVE~="ALL" then
dim filesys
Set filesys = CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("<full path with file name>") Then
filesys.DeleteFile "<full path with file name>", true
End If


Yes, but i usually call script from installation.
Answered 06/28/2011 by: naveen.packager
Green Belt

Please log in to comment
0
If you get that script to work as it is, I'll send you 48 million US dollars. Besides, what makes anyone think that a script has magic powers to delete files that the standard actions can't? Holy cow...

Look, the file is probably in use by the system (most likely the browser) and consequently can't be deleted. It's simple enough to determine what process has a file locked. You can then build your package so that it tests to see if that process is running and, if it is, uses some logic to proceed. Some people just outright kill the offending process (they clearly love to antagonise their users). Others failt the install and log the "problem" and/or display an appropriate message.
Answered 06/28/2011 by: VBScab
Red Belt

Please log in to comment
0
ORIGINAL: VBScab

If you get that script to work as it is, I'll send you 48 million US dollars. Bsides, what makes anyone think that a script has magic powers to delete files that the standard actions can't? Holy cow...


As always... you're right... I'm not the best in the scripting business, may be the worst. I thought that adding 'True' in the vbscrict could force to delete the file.

I know what processes are using these files, they're explorer.exe and winlogon.exe... how can I kill the processes ? or how can I unlock the files to delete them?
Answered 06/28/2011 by: cmi2000
Senior Purple Belt

Please log in to comment
0
I'll send you 48 million US dollars

don't know why Ian, but that made me think of you being like Scrooge Mcduck

Answered 06/28/2011 by: timmsie
Fourth Degree Brown Belt

Please log in to comment
0
If you get that script to work as it is, I'll send you 48 million US dollars. Bsides, what makes anyone think that a script has magic powers to delete files that the standard actions can't?

I mean't to say that adding true will force remove the file or folder and it may work for him. But i dint assure that.
Answered 06/28/2011 by: naveen.packager
Green Belt

Please log in to comment
0
...and *I* meant if you could make thisIF NOT REMOVE~="ALL" then work LOL

I'm trying hard to think of a file that might be held open by EXPLORER.EXE and/or WINLOGON.EXE that would be replaced by an ActiveX control (for that is surely what the bank software is installing, right?)...

So, out of curiosity, what's the file name and whose file is it, i.e. which company?
Answered 06/28/2011 by: VBScab
Red Belt

Please log in to comment
0
the plugin install 4 files in Program files\GBPlugin
These files are:
Gbpsv.exe (G-booster browser defense - service)
Gbiehabn.dll (Gbieh module) - Banco ABN AMRO
Gbieh.gmd
Abn.gpc
Answered 06/28/2011 by: cmi2000
Senior Purple Belt

Please log in to comment
0
...and *I* meant if you could this[blockquote]quote:

IF NOT REMOVE~="ALL" then [/blockquote] work LOL

Actual application was deployed already and OP wants to remove the file while installing the new application. So i suggested adding the script in new package with this condition.
Answered 06/28/2011 by: naveen.packager
Green Belt

Please log in to comment
0
I was googling about GBbSv.exe, I understood that these file it's about piracy defense and it remain "watching" registry changes, for that gbpsv.exe is being used by explorer.exe and winlogon.exe
So... is there any way to erase something in the registry or whatever to delete these files?????
Answered 06/28/2011 by: cmi2000
Senior Purple Belt

Please log in to comment
0
I'm willing to bet that GBPSV.EXE is running as a service.

Start 'SERVICES.MSC' and see if there's a service with a name like 'GB[something]'. Or, quicker, see if you can find 'GBPSV.EXE' in the 'Services' list in the registry, beneath 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services'. The EXE name will appear in the 'ImagePath' value. You'll find all the service details there, enabling you to control the service in your package, i.e. stopping it before continuing the uninstall.
Answered 06/29/2011 by: VBScab
Red Belt

Please log in to comment
0
Nothing works, read this:
"G-Buster fights spyware acting like a spyware. It installs a service with no warning about that. It cannot be removed. It consumes system resources. It pools the registry to make sure nobody is going to remove it (nobody or other spywares). But if Process Monitor can kill the thread (allowing you to remove the registry keys), any software would be able to do that"
It has been written in a forum about this application, so I have no solution to this problem. This problem came with the software, it seems to be without solution.
Thank you anyway
Answered 06/29/2011 by: cmi2000
Senior Purple Belt

Please log in to comment
0
Have you tried stopping that service and overwriting the file??
Answered 06/29/2011 by: naveen.packager
Green Belt

Please log in to comment
0
Of course! it was the first thing that I've tried.. the control over this service is disabled, I can't do anything...
Answered 06/29/2011 by: cmi2000
Senior Purple Belt

Please log in to comment
0
Thinking out of the box:
psfile -c? http://technet.microsoft.com/en-us/sysinternals/bb897552
or Pending File Rename Operations
Answered 06/29/2011 by: admaai
Orange Senior Belt

Please log in to comment
0
No, I've tried with psfile (it was just for try, because it's for other application), with other tool called "DelLater" that mark a file to remove during the next restart, and other tools like that... but nothing work. Finally, we've decided to delete these files manually on each computer, using WinPE, later release the new package.
Answered 06/29/2011 by: cmi2000
Senior Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity