Solved

Erase "uninstal.exe" in execution

Posted on 1997-06-14
3
140 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
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now