How to automatically update a C# .Net console application? - c#

I have a Console application (executable) written in C# .Net that users download and run locally.
The users download a zip and extract it to a local directory and run (using command line parameters) via the command line from that location.
Since users will not check for new version I need a way for the executable to check for a newer version of itself and automatically download it and overwrite itself (or at least notify the user).
I have looked at the possibility of using clickonce but that is geared towards windows applications.
All the questions/threads I have looked at only concern auto updating windows applications so are no good for this scenario.
Is there a way (or pattern) to auto update a .Net console app or do I have to write code within the console app to check its version against the server and notify the user?
If its made Clickonce it will break it as a console app - http://social.msdn.microsoft.com/Forums/en-US/8be48914-6563-47cb-9bff-e5e72047bb69/c-console-application-always-is-a-click-once-app

Related

Windows Application is installing seperate instance as opposed to updating previous version after publish

I'm currently working on a .Net framework 4 Windows application that I've inherited from another developer(that's left my place) that updates from a UNC location.
Whenever I take the old version of the app and publish the new version on top of it and run the setup it installs a separate instance of the application on the machine as opposed to updating the previous version, my suspicion is that this is due to the ClickOnce manifests being signed with a . PFX key that we have lost the password to, but I can't be sure that this is definitely the reason why.
does anyone know how I'd be able to publish the app up to update the previous version without the user having to uninstall/reinstall the app?

C# Check One Drive For Update To WinForm

I am using .net 4.5 and am deploying an .exe to several people. I am wanting to code in the form launch a way to check onedrive for an udpated version.
I see the built in auto-updater can deploy versions from the local machine, but I did not see in the MSDN that it can deploy from web.
What viable options do I have for a winform to check for updates and auto-download if avaliable?

Making my app stealth (avoiding leftovers)

I have a portable app that isn't stealth. And by stealth, I mean:
"Stealth" means when an application is launched, used and terminated properly, it does not leave behind any entries in the registry or filesystem.
My app runs under .Net Framework 4.6.1 and leaves behind a log file under the folder:
%AppData%\Local\Microsoft\CLR_v4.0_32\UsageLogs\ [App Name].exe.log
Who is creating this log file?
Is there any way to avoid the creation (without breaking the app)?
What's the purpose of this log?
With Windows 8 (.NET 4.5), a new NGen mode: "Auto NGen" has been
introduced. Basically, the .NET runtime generates usage logs for
managed applications. Source
Every time the application run it creates a new type of logs called
“Assembly Usage Logs” in the AppData windows directory.
Source
On my research I found out mostly that it only does this job on Windows 8+.
But in this source it says also on Windows Server 2012, but I have tried it on a Windows Server 2012 R2 and could NOT reproduce it!
I did not find a way to disable this, one solution could be to target a lower .net Framework within our application.

ClickOnce update with Apache server

I have been working on a C# application which needs bug fixes and updates once i deliver it to clients. I am currently trying clickOnce method of microsoft to provide updates.
For that i need to publish my application to server with frontpage server extension (If i am not wrong!). We are using windows server 2008 enabled machine, with Apache running, i googled regarding "Publish c sharp application on Apache server" and i found this workaround.
It edits .htaccess file to allow access to VS to publish application. But it doesn't seem working. I guess the page is out dated, written in 2006.
So my questions are:
How do i publish c sharp app on apache box?
How do we publish app? Using VS or any other method?
The manifest and payload (files) just need to be generated and then copied en masse to your server, it doesn't have to be a Windows machine.
Publish to a local folder/share and then replace the entire ClickOnce folder so that the code security values remain intact. I'd suggest you always rename your current folder and then copy your latest bits into a "new" folder that is your install location.
i managed to give updates with this workaround (i dont know how feasible is this! Need inputs!)
I used database to track version numbers and (link for) latest copy of software. Then i check for updates on startup. If new update is available it downloads exe (in app itself), closes app and run the setup.
I am using install-shield to generate setup. But when i run setup in machine which is already having older version of software, it doesn't update it, even though it displays its updating.
I know visual studio also provides option to create installation, but it isn't working either!

.NET Compact Framework - CAB auto update on Windows Mobile 6.5

I'm developing an auto update feature for my Windows Mobile 6.5 .NET CF 3.5 application.
I haev ended up with following solution.
I use SOAP WebService to check whether a new version of application is available.
If there is a newer version, I get the URL in SOAP response, download it. The new version is simply a CAB full installation file.
As soon as the version is downloaded i call wceload with /silent and /noui parameters on the downloaded CAB. I want unattended installation because users of this application are car drivers who are not so skill-full at operating mobile devices.
The process goes smoothly with one exception - the /noui or /silent options forces wceload to not display any window. My application simply dissapears and in the background the new version is installed. The problem is the drivers sometimes try to turn the application on again too soon. Another point is I'd like my application starts automatically after the update process is completed. So I created a separate exe application that simply calls wceload and if it completes installation it runs the updated version. All works with onr exception - this installer exe is part of my CAB so it is within it and when wceload installs the CAB, it shuts down the installer (because it is a part of the CAB installer). Thus, the installation process is interrupted.
My question is - is there a way to "tell CAB" to not terminate particular exe from those one that are part of this CAB?
Regards
It is not really responding to your question but you can do the following :
launch another (small) executable showing a "Update in progress" screen.
do your stuff behind the scene
[end of setup] => it starts your updated app
[Wait a little bit] => it closes itself and the updated app is ready to use
CAB installation and WCELOAD are limited in many ways. You're after some sort of UI that tells the user that things are in progress and you're wanting to conditionally install certain pieces of a CAB and that simply isn't achievable with wceload out of the box. You might be able to hack some of this together with a custom setup DLL, but I think the "conditional install pieces" is going to still be the show stopper.
One alternative is to not use wceload, but instead create your own CAB extraction tool. You could then do all of your own UI and custom logic based on the file name, etc. I put together an SDK and sample installer several years ago that would allow this - admittely it's not free, but the lowest cost option is only $5 so it's pretty close.
Newer CABs actually contain an XML doc that describes the install actions (in addition to the older .000 binary file descriptor that the SDK I wrote decodes), so it's also possible that you could do all of the extraction just using that and save the $5.
Dont use a cab. Use a tar.gz package with an executable and the cab inside. Use SharpZipLib for decompression. Just run the executable to do the work. Use the \windows\wceload tool to run the cab install.

Categories