Solved

Erase "uninstal.exe" in execution

Posted on 1997-06-14
3
160 Views
Last Modified: 2010-04-04
I'm writing an un-install program with Delphi 1.0. Win 3.1
How can i erase the file "uninstal.exe" in execution ?
I have the error message "file access denied".
0
Comment
Question by:Quartz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
sleach earned 100 total points
ID: 1337026
This is problem with Win95.  You CANNOT delete/overwrite a file that is currently in use.  Most uninstall apps usually leave a small amount of data for the user to delete manually.  Then you have to give the user a message with instructions on how to delete it manually.  This is probably NOT what you wanted to hear.

However, you might want to experiment with the DOS "lock" command.  It may give you what you want.  
0
 

Author Comment

by:Quartz
ID: 1337027
You did not answer my question !
Your answer is to leave the file there, and the user delete it manually ! My question was "How to erase it ?"  If you think DOS "lock" may help me, Ok, then answer my question, tell me how to erase the file.

Thank for your fast answer, i'm very happy. :)


0
 

Expert Comment

by:samjam062397
ID: 1337028
A batch file can delete itself, because DOS closes the batch file after reading each line.So you create a batch file which deletes the final few files, and then itself, and run it using winexec, and then exit quickly.You might have trouble exiting quickly enought so the batch file can delete you .exe, so you might also want to create a .com delay program for your batch file to call, and then delete as well.A sample batch file to delete itself is: t.bat@echo offecho heredel t.batecho too late, gone.The trouble is you then need a pif file to go woth the bat file to make sure DOS closes on exit, and stuff like that.When you winexec the batch file, run it in miniized mode...
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question