Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Erase "uninstal.exe" in execution (2)

Posted on 1997-06-16
10
Medium Priority
?
232 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 600 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

Industry Leaders: 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

704 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