Results 1 to 5 of 5

Thread: writing files/moving files architecture...

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    writing files/moving files architecture...

    hey, hope your well.

    I am having a bit of a bother trying to figure this one out, my mind is all over the place and havent had much sleep!

    ok, my application can check for an update on the net using webservices. if an update is availiable it downloads it and puts it in the "Files/yyy" folder. the app runs as normal after the update.

    now, after the update, it is recommended to run the new app, but the new app is in the Files/yyy folder. Fair enough, no problem, user goes into that folder and runs the latest version of the app.

    same thing again, user can check for update, if update is available, it puts it into the Files/yyy folder, so this time:

    Files/yyy/Files/yyy

    see where I am going?

    how can I copy/move the updated file into the directory the application is running from - but the updated app has the SAME filename as the current running app.... how can I resolve that problem? I dont want to have to rename the updated file when its transferred....

    what possible solutions could there be for this scenario? Is there one?

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: writing files/moving files architecture...

    you can possibly make a "update.exe" file ( separate program) that would wait for the old version of app to quit (you could check to see if the app has quitted using the list of system processes in system.Diagnostics.Process....). If so then update.exe could simply delete the old app file and move the updated file into the correct application directory.

    You could even close the app and ask the user to run a BAT file once the app has closed
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: writing files/moving files architecture...

    well yeh i could do that but dont want to have to make a seperate app just to do the update....

    i want the app to do everything itself wherever possible

  4. #4
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: writing files/moving files architecture...

    hmm well it'd be impossible for the app to move/delete its exe if it's already running. So you'd either have to write another exe to do it, make a BAT file, or hmm cant think of any other way?

    it seems impossible, how else could this be done?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  5. #5
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: writing files/moving files architecture...

    I know you didnt like my last idea, but still elaborating a bit more on it
    you could make a "launcher.exe" application. Make the shortcut of your app to this exe. When you run it, it would check to see if any updates have been put to your special update folder, if so then it would replace the update file with the old program file. After that you can run the application by doing Process.Start() and you can close the launcher.exe program.

    hopefully someone else will give a better idea
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width