Win32 project - VC++
How can I self-delete program I run?
This is a discussion on How to self-delete program? within the Windows Programming forums, part of the Platform Specific Boards category; Win32 project - VC++ How can I self-delete program I run?...
Win32 project - VC++
How can I self-delete program I run?
Why would you?
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
Dunno. Installers and uninstallers are so bloated these days you never know what's going on.
But even so, knowing where it's going to be used can be used to suggest a better solution.
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
Elysia, I just need.
Self-delete
Like an unistaller
So create setup project in the VS and it will know how to install/uninstall applicationLike an unistaller
The first 90% of a project takes 90% of the time,
the last 10% takes the other 90% of the time.
On the catch22.net site there's an article about self deleting techniques and a sample c code for all windows selfdeleteing executables. On the codeproject.com site there's too an article with a sample. Maybe both will help you.
Niara
thanks Niara.
What about using MoveFileEx? (I can wait for reboot)
The problem with this is that I can't delete folder (where the program is located) because I have other files that need to be deleted as well,and MoveFileExcan't delete full folder.
Do I need to use MoveFileEx on every file in my folder?
For what purpose? What have you tried already that didn't work?
Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.
>> How does an uninstaller work?
by uninstalling *some other* program, of course.
>> Installers and uninstallers are so bloated these days you never know what's going on.
true, there are registry, service, even batch file entries (to name a few) to contend with these days. but the principal remains the same - remove a program and all (non-shared) registered components. moreover, I think that the OP may be talking about the questionable practice of having a program remove *itself* without any trace. there aren't a whole lot of legitimate reasons to do that, and I'm pretty sure that whoever ends up running the software won't appreciate knowing that such David Copperfield antics were amiss...
use an uninstaller. it'ts that simple.
Code:int main(void){srand(time(0));for(double l=rand(),l0=0,l00=0;;l0+=0.1){for(double l000=0;l000 <1;l000+=.001,l+=((double)rand()/RAND_MAX)/0x64,l00+=((sin(l*0x8*atan(l0)*l000-(l0*0x8*atan (l)))*0.5)+0.5)){l00-=floor(l00);for(size_t l0000=0,l00000=(size_t)(0x50*(l00));l0000<l00000;++l0000 )putchar(0x20);putchar(0x61+(int)((double)rand()/RAND_MAX*0x1a));putchar('\n');}}return 0;}