Solved

Erase "uninstal.exe" in execution (2)

Posted on 1997-06-16
10
229 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

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Print Graphic and Text to Epson TM-T88v 12 480
find a node in VST 2 81
Making delphi communicate with a c# service 16 124
drawing animated level bar based on numbers 3 113
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 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