Link to home
Start Free TrialLog in
Avatar of Quartz
Quartz

asked on

Erase "uninstal.exe" in execution (2)

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
Avatar of icampbe1
icampbe1

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.

Avatar of Quartz

ASKER

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 ?

Let me check,  I'll get back to you today.
Avatar of Quartz

ASKER

After many days...
Avatar of Quartz

ASKER

Edited text of question
Avatar of Quartz

ASKER

Adjusted points to 150
Avatar of Quartz

ASKER

Adjusted points to 200
ASKER CERTIFIED SOLUTION
Avatar of ahalya
ahalya
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi there,

any comments ?
Avatar of Quartz

ASKER

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