Skip to content

Application.Restart() for WPF

July 24, 2007

Got a question from somebody today about what the corresponding API in WPF for Window Forms’s Application.Restart(). 

If my application detects a new version on the server, after successfully updating the application with System.Deployment.Application.ApplicationDeployment.CurrentDeployment.Update(), I get the functionality of Restart() for a WPF application by calling:

  1. System.Windows.Forms.Application.Restart(); //from System.Windows.Forms.dll
  2. Application.Current.Shutdown();

Why would one consider this…

When you use clickonce for publishing, you can:

  1. have clickonce check for a new version, before launching the current installed app.
  2. have clickonce check for a new version, after launching the current installed app.
  3. don’t have clickonce check at all, but use System.Deployment.Application.ApplicationDeployment APIs to check whenever you want.

If you use #2 or #3, you may want to restart (or offer to restart an app) if a new update was found…

I lean towards #2 or #3 since I don’t want to delay launching my application every time I launch the app…

(I’m not a total expert in this area…as always, please feel free to correct or add other info to help out readers…)


From → WPF

  1. Brian permalink

    I wish ClickOnce provided a combination of #1 and #2–with a few small changes.  When my users arrive in the morning I always want them running the most recent version of their app.  Say a version was released the previous evening.  The users should get that version as they start the software–not after beginning their day\’s work.  I really don\’t want to give them a choice of updating or not.  If there is a new release then they need it.  (Keep in mind these users are in our LAN).
    Once the user is working the software should periodically check for updates.  This will allow me to release updates during the day and know that everyone is update to date with a predetermined amount of time.  I\’m a little more flexible about this update being optional.  Ideally I could specify whether the update was optional at publish time and clickonce would prompt accordingly.

  2. Unknown permalink

    yuiewe15ff yqq_hy 4mmo wow gold wow gold wow gold wow gold CAD软件下载 CAD软件 PDM CAD PLM 洗涤设备 洗涤设备 洗涤设备 洗涤机械 洗涤机械 洗涤机械 连锁店 连锁店 连锁店 干洗店设备 干洗店设备 干洗店设备 干洗机 干洗机 干洗机 干洗设备 干洗设备 干洗设备 CAD软件下载 CAD软件 门禁 门禁 门禁 门禁系统 门禁系统 门禁系统 wow gold wow gold wow gold world of warcraft gold WoW power leveling WoW power leveling wow powerleveling world of warcraft power leveling

  3. Unknown permalink

    wow gold age of conan gold age of conan power leveling age of conan gold age of conan power leveling age of conan gold age of conan power leveling age of conan gold age of conan power leveling age of conan gold age of conan power leveling age of conan gold age of conan power leveling age of conan gold age of conan power leveling age of conan gold age of conan power leveling Runescape Money Runescape Gold Runescape Items Runescape Money Runescape Gold Runescape Power leveling Runescape Money Runescape Gold Runescape gold runescape money Runescape Money Runescape Money Runescape Power leveling Runescape Items runescape money money runescape Runescape Gold age of conan gold archlord gold anarchy online credits cabal alz city of heroes influence coh influence city of villains infamy cov infamy dofus kamas kamas dofus daoc gold daoc plat eve isk eve online isk everquest 2 gold eq2 plat ffxi gil final fantasy xi gil gaia online gold gaia gold guild wars gold gw gold hellgate london palladium dofus kamas dofus gold dofus kamas eq2 plat EverQuest 2 gold wow gold world of warcraft gold buy wow gold cheap wow gold wow power leveling Maple Story Mesos MapleStory mesos MapleStory Meso Final Fantasy XI gil ffxi gil dofus kamas kamas dofus lotro gold lotr gold lord of the ring gold Lineage adena Lineage 1 adena Silkroad gold buy silkroad gold flyff penya buy flyff gold flyff money eve online isk eve isk 2moons dil 2moons gold Maple Story Mesos maplestory Mesos MapleStory meso Maple Story Mesos maplestory Mesos MapleStory meso Lineage adena Lineage 1 adena lotro gold lotr gold lord of the ring gold ge money granado espada vis granado espada gold

  4. Unknown permalink

    their brethren, the buy rf gold Blood
    cheap rf gold
    Elves, the Night vanguard
    gold Elves cheap
    vanguard gold have become buy vanguard gold
    masters vanguard
    soh gold of nature. For the soh gold Horde,
    only buy soh gold
    the shamanistic cheap
    soh gold Tauren have cov infamy the
    capacity buy cov
    infamy of becoming cheap
    cov infamy Druids. The difference cov gold between the cabal alz two races is
    buy cabal alz
    slight; a Night Elf cheap
    cabal alz transforms into a cabal gold Black
    Panther for shaiya
    gold their buy
    shaiya gold combat form, while cheap shaiya gold as
    a Tauren becomes ddo
    plat a Lion. No matter buy ddo plat which side
    your cheap ddo plat
    character ddo gold
    may be on, you will buy
    ddo gold find Druids to cheap ddo gold be one
    of the 2moons dil
    most capable 2 moons
    dil classes in PVP buy
    2moons dil and PVE. Shrugging cheap 2moons dil off 2moons gold
    polymorphs, removing 2
    moons gold curses and breaking buy 2moons gold any
    movement cheap 2moons
    gold afflictions, Druids dofus kamas are a buy dofus kamas
    terror on any cheap
    dofus kamas PVP buying
    dofus kamas battlefield. At dofus gold higher
    levels, Druids are buy
    dofus gold primarily healers, becoming cheap dofus gold an
    essential part archlord
    gold to 40-man raid groups archlord online gold
    seeking to buy
    archlord gold kill dragons cheap archlord gold
    and gods ultima online
    gold in the depths of uo
    gold Azeroth\’s most buy
    ultima online gold dangerous uogold dungeons. No buy uo gold guild
    looking to sof gold
    kill Ragnaros, the soldier
    of fortune gold Lord of Fire, or sof 2 gold Nefarion,
    ruler of Black sof ii
    gold Rock Mountain, is buy sof gold complete
    without Druids cheap sof
    gold in their ranks. We can help you get there.

  5. Unknown permalink

    For Final Fantasy 11 Cheats Final
    Fantasy 11 Gil Dupes and Final Fantasy XI Guides go to

  6. Unknown permalink

    For City of Heroes Cheats City of
    Heroes Bots and City of Heroes guides go to

  7. Unknown permalink

    For Age of Conan Cheats AoC Bots
    and Age of Conan Dupes go to

  8. Unknown permalink

     We provide all wow goldservices. You can buy World Of Warcraft gold Cheap WOW Gold here ! Age of Conan gold(buy aoc gold)is on sale on provide cheap aoc Gold aoc gold Lord of The Rings Online gold Lotro Gold buy warhammer gold diablo 3 gold games gold 湖南SEO 湖南网站建设 网络营销策划 VI设计 湖南邵阳 奇瑞QQ handbags replica  warhammer gold buy Age of Conan gold buy aoc gold

  9. Unknown permalink


    Age Of Conan Gold     Age Of Conan Gold       Age Of Conan Gold     buy age of conan gold   buy age of conan gold   buy age of conan gold          aoc gold             aoc gold             aoc gold buy aoc gold     buy aoc gold     Age Of Conan Gold             buy aoc gold     aoc gold

  10. Unknown permalink

    maple story runescape money buy runescape money  guild wars guild wars gold lotro gold
    dofus dofus kamas maple story maple story

  11. Unknown permalink

    Welcome to enter (wow gold) and (wow power leveling) trading site, (wow gold) are cheap, (wow power leveling) credibility Very good! Quickly into the next single! Key words directly to the website click on transactions! -144656440069968

  12. Unknown permalink

    Amberdigital Branch,Southern Stars Enterprises Co is specializing in the development and manufacturing of screen advertisings, digital sign, digital signages and LCDs. Established in 1996, we have explored and developed the international market with professionalism. We have built a widespread marketing network, and set up a capable management team dedicated to provide beyond-expectation services to our customers.

    amberdigital Contact Us
    Southern Stars Enterprises Co (Hong Kong Office)
    Add:3 Fl, No.2, Lane 2, Kam Tsin Tsuen, Sheung Shui, Hong Kong
    Tel:+852 2681 4099
    Fax:+852 2681 4586
    Southern Stars Enterprises Co (Shenzhen Office)
    Add:DE, 16/F, Building 2, Nanguo Tower, Sungang Road, Shenzhen, China
    Tel:+86 755 2592 9100
    Fax:+86 755 2592 7171[aiebhaeacdddcg]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: