Results 1 to 6 of 6

Thread: Application that run once,and Delete itself!

  1. #1
    Join Date
    Dec 2007
    Posts
    129
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Application that run once,and Delete itself!

    How can i create application that will run once and after that it will "delete itself" in windows OS?

    im trying to use QFILE::remove() but its not working..

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Application that run once,and Delete itself!

    May I ask what do you intend to do?

    Windows won't let you delete a file which is in use. The executable is in use while running the program. What you can do is to delete it from another process or mark it to be deleted upon next Windows startup.
    J-P Nurmi

  3. #3
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    40
    Thanked 8 Times in 4 Posts

    Default Re: Application that run once,and Delete itself!

    It sounds like you are working on a "intruder" application : )

    good luck.
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  4. #4
    Join Date
    Dec 2007
    Posts
    129
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Re: Application that run once,and Delete itself!

    nope not intruder application..

    Im creating a utility which is design to run once cause if it runs again it may cause problems, It is design to delete some data, to fixed problem on first run but on the second and so on it will be the cause of bigger problems..

    my solution until this time is I created a "deleter" to delete the application after running..

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Application that run once,and Delete itself!

    How do you delete the deleter?

  6. #6
    Join Date
    Dec 2007
    Posts
    129
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Re: Application that run once,and Delete itself!

    i dont.. i just put an argument password so that i can reuse it if i have to create other same type(run once) of utility..

    cross platform is hard, in linux its ok but in windows its not.. hayzzz

Similar Threads

  1. Task to another application
    By zlosynus in forum Qt Programming
    Replies: 0
    Last Post: 6th August 2008, 11:04
  2. dll + application
    By fpujol in forum Qt Programming
    Replies: 11
    Last Post: 15th April 2007, 19:37
  3. Replies: 3
    Last Post: 8th December 2006, 19:51

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.