Re: [NAppUpdate] NAU and Console Applications

261 views
Skip to first unread message

Itamar Syn-Hershko

unread,
Apr 10, 2013, 6:16:01 AM4/10/13
to nappu...@googlegroups.com
In general, you should use a URL to download the feed (or get the feed using some other source implementation), so using direct links to files is probably a bad idea

I didn't write the feed generator app, and from previous reports it seems to be a bit buggy. Can you post your XML?


On Wed, Apr 10, 2013 at 7:49 AM, Brendan Thompson <bre...@btsystems.com.au> wrote:
Hi All,
 
I came across NAU today, which was fantastic as I want to implement auto updating in a console application of mine. I have some requirements though, and that is that there are no DLL files or any other files required outside of my primary exe file.
 
What I did was grabbed all the source code and put it inside of my application, that worked after changing some references.
 
What I need is a bit of guidance in setting this all up I read the blog article that was linked elsewhere and it hasn't been that beneficial to me. I keep getting errors with the XML file saying that I need to check the feed (the XML was made by the feed creater app) It also seems as though the update cannot process if cannot find an XML file in the same dir as the exe. What options do I have here?
 
Thanks,
 
Brendan

--
You received this message because you are subscribed to the Google Groups "NAppUpdate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nappupdate+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Brendan Thompson

unread,
Apr 10, 2013, 6:45:05 PM4/10/13
to nappu...@googlegroups.com
Hi Itamar,
 
Below is my XML:
 
<?xml version="1.0" encoding="utf-8"?>
<Feed BaseUrl="http://updates.domain.com/LogQuery/Beta/">
  <Tasks>
    <FileUpdateTask localPath="LogQuery.exe" lastModified="130100374455321846" fileSize="189952" version="1.4.1.0">
      <Conditions>
        <FileExistsCondition type="or" />
        <FileVersionCondition what="below" version="1.4.1.0" />
        <FileChecksumCondition type="or-not" checksumType="sha256" checksum="52938DC71037D00211323AA023E46A6BC9DFE0197C442D028115E2596B8168FB" />
      </Conditions>
    </FileUpdateTask>
  </Tasks>
</Feed>
 

public

static void CheckForUpdatesAndApply()

{

var updateManager = UpdateManager.Instance;

IUpdateSource src = new SimpleWebSource(@"http://updates.domain.com/LogQuery/Beta/LogQuery2.xml");

updateManager.CheckForUpdates(src);

updateManager.PrepareUpdates();

updateManager.ApplyUpdates();

}

 

Above is my testing method for NAU, as I just want to get it working from that external source and preferably without requiring to manually have to put the LogQuery2.xml file in my applications directory (the one I am trying to update)

 

Thanks,

 

Brendan

Brendan Thompson

unread,
Apr 10, 2013, 7:27:27 PM4/10/13
to nappu...@googlegroups.com
I updated my app and now I seem to be able to get to the update stage, however when it calls updater.exe (embedded into my app) it errors out, saying "NAppUpdate - .NET Application Updater has stopped working" I even rebuilt the exe for this! Any ideas what is going on here, and what I can do to resolve it?
 
It's weird as it was working and updating yesterday from a local source
 
Thanks,
 
Brendan

Brendan Thompson

unread,
Apr 10, 2013, 11:21:52 PM4/10/13
to nappu...@googlegroups.com
Okay!
 
Got the DLL section working now and it looks like it's building things correctly, however it still isn't updating :(. In the DLL the get's put in the temp directory the NauIpc class isn't present, so I manually added that class to the updater.exe assembly. I now get the following log output:
 
11/04/2013 13:18:30.715   Debug Starting to process cold updates...
11/04/2013 13:18:30.720   Debug Update process name: 'NAppUpdateProcess'
11/04/2013 13:18:30.722   Debug Loading C:\Users\Brendan\AppData\Local\Temp\e9387565-5d43-4337-a973-289c43559ba8\foo.exe
11/04/2013 13:18:30.722   Debug  Skipping (part of current execution)
11/04/2013 13:18:30.722   Debug Loading C:\Users\Brendan\AppData\Local\Temp\e9387565-5d43-4337-a973-289c43559ba8\LogQuery.dll
11/04/2013 13:18:30.830   Debug The application has terminated (as expected)
11/04/2013 13:18:30.832   Error 
System.Exception: Invalid DTO received
   at NAppUpdate.Updater.AppStart.Main()

Itamar Syn-Hershko

unread,
Apr 11, 2013, 3:31:45 AM4/11/13
to nappu...@googlegroups.com
1. You don't need FileExistsCondition. The other 2 conditions will be satisfied if the file doesn't exist.

2. Can you try this with Nau as an external DLL? I suspect this has something to do with you compiling it yourself and updater.exe compiled differently somehow.


--

Brendan Thompson

unread,
Apr 11, 2013, 11:06:30 PM4/11/13
to nappu...@googlegroups.com
Hey Itamar,
 
Okay so using your DLL works perfectly! :) Can you think of a way for me to not have the DLL floating about? As I want to ship only my .exe file.
 
Thanks,
 
Brendan

Itamar Syn-Hershko

unread,
Apr 12, 2013, 3:18:23 AM4/12/13
to nappu...@googlegroups.com
Yeah, use an installer... look at InnoSetup, really easy to use


--

Brendan Thompson

unread,
Apr 12, 2013, 9:07:57 PM4/12/13
to nappu...@googlegroups.com
That would take away from it's portablility. I need some way to merge the DLL into the exe, or something along those lines. I don't want to have to install it. But I will be checking out your app :).
 
Can you think of any way to do this? I mean I was sort of successful, obviously part of my implementation was just failing. I know it wasn't compiling the NauIpc class file into the DLL for some reason. Is there anyway you can think to do this?
 
Thanks,
 
Brendan

Itamar Syn-Hershko

unread,
Apr 13, 2013, 1:03:48 PM4/13/13
to nappu...@googlegroups.com
Not really sure why this happened TBH


 
Thanks,
 
Brendan

--
Reply all
Reply to author
Forward
0 new messages