Solved

Erase "uninstal.exe" in execution (2)

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

Author Comment

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

Author Comment

by:Quartz
ID: 1337107
Edited text of question
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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 Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now