Results 1 to 11 of 11

Thread: Replacing original file and permissions?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2008
    Posts
    131

    Replacing original file and permissions?

    Hey, I've got two programs, one is the main and the other is the updater. So far iv'e got it so that the main program checks for an update by comparing its version number with the latest one that's stored as a text file on the server. If there's a newer one, the update program is started and the main one closed. The update program will then use a web browser component to navigate to the download link and download the new version. The only problem I'm having at the moment is, How can I get the new downloaded version to replace the current one in Program Files? and will this cause permission problems? Thanks.
    Adam

  2. #2
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Replacing original file and permissions?

    As you said, you close the main application. As long as its not in use and you have no policies that block you from this type of operation (I have seen firewalls that know the .exe is different and block it!) then it should work. Have you tried it , thats the best way to get your answer.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2008
    Posts
    131

    Re: Replacing original file and permissions?

    Right the updater is going to be a simple VB downloader which will pull the new version from the server and place it in the program files directory. But I get an access to the path C:\Program Files\Test is denied? Anyway around this? Thanks!
    Adam

  4. #4
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Replacing original file and permissions?

    Without seeing your code can't give you much advice, have you tried this in any other folder outside ProgramFiles? It could be you don't have access to that folder, which would be strange if you have full rights (but not if you don't ). You sure the files are still not used? It's best to download to a sub-folder and then replace when all files are downloaded in case any 1 download fails, you don't end up with a "broken" version with half moved files. Once all done you can move them over.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Dec 2008
    Posts
    131

    Re: Replacing original file and permissions?

    Well my install has always been a bit weird as far as permissions has gone, sometimes it still asks me for admin rights when I'm the only user of this computer and am also Admin :S Needs sorting out! But that would also mean only people with set permissions could update the program. Well the updater is only downloading one exe and replacing the one in program files with it. So I cant really see a sub-folder being needed. I've attached the downloader to the post, maybe you could see if its just my pc permissions messing about? Its a downloader I got from somewhere else on the internet, but if working will work perfectly for what I want.

    exe only: http://www.megaupload.com/?d=UUBIUPLH
    All Files : http://www.megaupload.com/?d=DE4UZ51E
    Adam

  6. #6
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Replacing original file and permissions?

    That sometimes still asking will be UAC and its likely to interfere with any changes you attempt to do, by code or manually to programfiles/windows etc. You gotta jump that hurdle .

    Heres a post with a similar situation.
    Last edited by Grimfort; Aug 25th, 2010 at 04:39 PM.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Dec 2008
    Posts
    131

    Re: Replacing original file and permissions?

    But I'm not even being prompted by UAC to say yes or no. I'm just being told by the program "No" :/
    Adam

  8. #8
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Replacing original file and permissions?

    Its code thats starting it, so I guess it knows that can't exactly answer the dialog so "computer says no".

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Dec 2008
    Posts
    131

    Re: Replacing original file and permissions?

    So are you saying that way isn't going to work then? :/
    Adam

  10. #10
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Replacing original file and permissions?

    No, I'm saying read that thread I posted about.

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Dec 2008
    Posts
    131

    Re: Replacing original file and permissions?

    AH HA! Now when opened the user must accept the UAC which then allows the program to run as admin then to install to program files! Looks like all I need is done! Thanks for your help! Rated
    Adam

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