Solved

Erase "uninstal.exe" in execution

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

696 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