Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 989
  • Last Modified:

Visual Basic 2008 how to autoupdate my application at startup.

Is there a way to Autoupdate an application when it start without using the publishing wizard ?

I want my program to reside in program files dir not some strange encrypted dir because I start other projects from wihtin one project.

Is there a way to run or call an autoupdate by code ?
  • 3
  • 2
  • 2
1 Solution
Just a simple question first : I didn't understand why you don't want to use the publish tool of VS.
According to the screenshots bellow you're not obliged to deploy into some "some strange encrypted dir" !
Think also that you can use the Update Option, but I think you knew it already.

I think you should dig on the existing tools instead of trying to reinvent the wheel if possible. So let's try to discover what you assume is not possible without coding.

BTW, don't you need a setup project ?
siacomAuthor Commented:
Well I was not refering to the location of the installation files I was refering to the location of the FINAL installed application.

If you are extremely lucky to find your precious installed apllication you'll problably find that it has installed it in C:\Users\ME\AppData\Local\Apps\2.0\XM4QGLJJ.WBD\M9HBKMXB.X4Z
for example ....  

and I need to refer to another project which I call claims plus others.
now when I publish my WORKING application it will not find claims or any other projects for that matter.

the code below is an example of how i refer to projects all having the same "suite" name but different product names, hence they all reside in the same "suite" directory and can be refered to easily with the \..\  ...
works fine if I create a setup project and run it.. however after setup has finished it will not check for updates :(

Dim PathName As String = My.Application.Info.DirectoryPath
PathName += "\..\claims\claims.exe"

Open in new window

You didn't answer concerning the "Application Update" dialog that I forwarded. You only speak about publishing the application.
It seems you think that this option is not impacting your project if you don't use the publish wizard. I think that you're wrong : http://msdn.microsoft.com/en-us/library/1zyc39fb.aspx

Nevertheless, if it still doesn't match your requirements or if I misunderstood this setting, then if you want to do it programmatically, an possibility would be to dig around the use of the System.Deployment.Application.UpdateCheckInfo class and the System.Deployment.Application.ApplicationDeployment class:
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

ClickOnce is the easy and best method for automatic updates. You have some limitations, that's right, but you have allot of advantages.
If you want to install your application in the Program Files, you can create a Setup Project and use another update method. You can find some easy examples like this:
(and you have more there)
siacomAuthor Commented:
ic.. looking at the example I would much prefer to just use the publishing wuzard.

So to get this right there is absolutely no way of finding out where the application will be installed in and no way of assigning a folder name ?

at the moment publishing wizard installs the app in:

and if I want to run another project there is no way of finding out where that other project will be installed after using the publishing wizard ?

having a look at the examples, at this stage it would be a lot easier for me to create one text file with update=true ;-) and then run setup.exe

To clarify: you what to run what application ?
Remember the clickonce deployment will autostart the application an you can use the form load event to do what you need.
siacomAuthor Commented:
Well basically due to the size and design of this application I have split it into 3 different projects connected to the same sql database. They have been split because they are too different to use classes and objects and i would need to instatiate too many objects (very messy).

SO... The first application is the login program that checks your network login name against the users table and your group name. depending on your group name it will load the application designed for that group.

say the publisher is MyCompany and the Suite is CompleteApp then each project would reside in "Product Name" using a setup project would look like:

As you can see Dim PathName As String = My.Application.Info.DirectoryPath will find out where login resides and therefore:
 >>    PathName += "\..\App2\App2.exe"  <<
will run if they belong to group 2.

This works great, but if I use publishing, then I cannot set a main folder for all compiled projects wihtin the solution.

Mostly only one of the project will be updated at any time.

when I looked at the ClikOnce application API there is a bit of work building the manifest with mage.exe and a lot more prep work then the Publishing wizard, since I limited with the amount of time to release version one, I don't have time to make this work prefectly yet.


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now