Solved

Erase "uninstal.exe" in execution (2)

Posted on 1997-06-16
10
227 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
  • 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

770 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