I am building a project in C# dot net in which i want to detect any save operation of windows to run my project.
It means that when user do any save operation then project will also create a copy of that saving file.
So please help to detect any save operation in windows
You can detect modification of files using FileSystemWatcher class.
If you want to detect file modification in Visual Studio than you might need to write a VS extension.
By the sound of it all you need is a source control software, like Subversion, Mercurial or Git.
Related
I am trying to make autoupdate check and upgrade procedure (now from location on shared drive, in future maybe from server).
I have created "Visual Studio Installer" project that creates setup and it is possible to install the app. Also I have created another binary that searches for updates - if there are updates and user wants it, it runs the setup and app ends - if no updates, it runs main program. I have selected 2 binaries system in order to have possibility to run app without updates checking.
But If I confirm the update I am getting "Another version of this product is already installed. error code..." dialog.
I am not sure if my approach is right, probably not. But I found only commerce solutions and ClickOnce which seems to be for updating from network.
Thank you in advices for your answers.
It seems you are looking for something that allow you to have folder in your disk or a shared drive that can be used as local server to help you make updates without using internet connection , I introduce you to Squirrel.Windows its an open source installation and update framework for Windows desktop apps.
Here is link for Getting Started With Squirrel.
And here is a Youtube Video by Tim Corey where he explain Squirrel practically with demo windows forms project.
Happy Codding...
I'm planning to have my C# app update automatically by comparing version numbers and downloading a package with the new files from my server over HTTPS.
Is this enough? Can I somehow validate that the file I downloaded is indeed the one I wanted? Is there something in .NET 4.5.1 that resembles iOS's App Transport Security?
Perhaps not exactly what you, but you can use the ClickOnce installer, which is available in Visual Studio. It will check for updates automatically and hashes the files downloaded and verifies the checksum with the one on the server to ensure it is the correct one.
To enable automatic updates go to the Properties of the projects, then go to the Publish tab, click Updates, and then check The application should check for updates
To create the installer go to the build menu and click Publish application_name
Hi I am developing a WPF c# project and want to attach a text file and image file integrated into it so that if I export executable file to any other PC, It will run easily...
you are thinking about this in the wrong way, Visual Studio doesn't manage installation on Client machines it only handles building the code for you to run, the thing that manages the installation is the installer
if you want to use a publish installer like click once then you can use Visual Studio to set the publication rules (see https://msdn.microsoft.com/en-us/library/142dbbz4%28v=vs.90%29.aspx), otherwise you actually need to create an installer (see https://msdn.microsoft.com/en-us/library/gg513936.aspx)
EDIT: If i'm misunderstanding your question which i took as how do you get your resourced files to be on the client machine with the exe file, if your question is how to Embed thee resource in the first place then How to refer to Embedded Resources from XAML? provides a very good answer
I have a C# project that I've written using the .NET 4 framework, I've created an installation project using the setup wizard within the solution, the problem is that once the program is installed and I launch it, a dialog appears saying that the program is being configured and then starts the program, why is this? Is it necessary? How can i prevent this from appearing or happening altogether?
UPDATE
I installed my application and launched the application from the .exe created in Program Files and a config window didn't appear and the app launched normally! How do i create a link to this shortcut without it showing the windows shown above? As i need to place a shortcut to the users startup folder.
This happens because Windows Installer detects missing resources. For example, some of the installed files were moved/removed/renamed or were installed per-user for another user account.
Here is an article with more details: http://setupanddeployment.com/general-installation-problems/preparing-install-popping/
You can use Event Viewer to determine which resource is causing this, like explained in the article I mentioned.
The MSI file has auto-repair enabled. I don't think VS has an option to turn it off.
The shortcut links generated don't actually link to the files they should. They link to an executable in appdata. When that file's opened, it runs the installer repair check silently and opens the configuring dialog while any repairs take place. For some reason the installer thinks that files installed with your program are being deleted / corrupted. Perhaps temporary or configuration files?
This link given in this question should fix it if that's the case, but it'll still be activated if the user hits Repair in Add/Remove programs.
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.