Solved

Erase "uninstal.exe" in execution (2)

Posted on 1997-06-16
10
230 Views
Last Modified: 2010-04-04
Hi,
For Delphi 1.0 / Win 3.1
I'm writing an un-install program. I whant to know how
can i erase the file "uninstal.exe" in execution ?
I have the error message: "file access denied".

I do not whant to know if i have to experiment with DOS "lock".
I do not whant to know if i have to flag it directely in HD FAT.
I do not whant to know what other coders do (leaving the file there).

The answer must be a procedure or a function in Delphi 1.0 codes.

I know it not a big procedure, then you can easy put it in a message.

Thank in advance,
Quartz
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
  • 6
  • 2
  • 2
10 Comments
 
LVL 2

Expert Comment

by:icampbe1
ID: 1337103
I assume that the program is trying to erase itself?  If so, it is running and that's why it is busy and you can't erase it.  I assume you know that.  I also assume that you have checked to ensure that it is not read only.

The way to remove a busy file is to use the WinInit processing facility.  Make the NUL=fname entry in the WinInit.INI file and on the next restart, WinInit.EXE will delete the file.  

If you are not familliar with this, I can be more specific.

Cheers,
Ian C.

0
 

Author Comment

by:Quartz
ID: 1337104
I was thinking about others solutions. I always think executive file are all load in memory before it start then close the file.
I have some programs like Asymetrix3DFX and HP JetAdmid who have an uninstal program and erase the file.
Ok, for the restart of Windows, but in Win 3.1 i do not have the "winini.ini".  Is there something similar of "NULL=fname" for the file "win.ini" of Windows 3.1 like my question mentioned ?

0
 
LVL 2

Expert Comment

by:icampbe1
ID: 1337105
Let me check,  I'll get back to you today.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Quartz
ID: 1337106
After many days...
0
 

Author Comment

by:Quartz
ID: 1337107
Edited text of question
0
 

Author Comment

by:Quartz
ID: 1337108
Adjusted points to 150
0
 

Author Comment

by:Quartz
ID: 1337109
Adjusted points to 200
0
 
LVL 7

Accepted Solution

by:
ahalya earned 200 total points
ID: 1337110
i don't understand what you mean by  "experimenting with DOS Lock" ? If that means "No DOS batch Files" then don't read any further. Reject this answer right away !

DOS Batch files can delete themselves without making any complaints [when the line containing the "DEL batchname.bat" terminates with a CTRL-Z]

so if you create a batch file on your formclose event and Execute it as the last step in your Uninstall.EXE then you can get rid of your EXE & BAT.

The BAT will consist of the following:[literally speaking :-)]

Wait for a few minutes [couple of loops in the worst case]
Del "UnInstall.EXE"
Del Batname.bat<CTRL-Z>

Remember the <CTRL-Z> after batname to avoid the "file missing" error. initial delay is to make sure that your app has terminated.

0
 
LVL 7

Expert Comment

by:ahalya
ID: 1337111
Hi there,

any comments ?
0
 

Author Comment

by:Quartz
ID: 1337112
Hi, sorry for the time for my answer to you.

After testing your sugestion, it not what i was asking but it working ok.   I execute the .bat file on the event "OnDestroy" of my form and it working good.

Thank for your help and i give you your's points.

See you..
Luc

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

734 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