Microsoft Developer Network > Página Inicial dos Fóruns > Visual C# General > Handling Installer Minor Revision Changes
Fazer uma PerguntaFazer uma Pergunta
 

PerguntaHandling Installer Minor Revision Changes

  • terça-feira, 3 de novembro de 2009 22:13jp2msft Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    I'm constantly pushing out small updates at our company due to some minor unforseen piece of the puzzle that is discovered during the manufacturing process. My application may change from 2.1.0.5 to 2.1.0.7 because I need to read in "6 text characters including the a space" instead of 5 characters like I was told. {sigh!}

    Anyway, I rebuild my application, rebuild my Setup and Deployment project (also part solution), then go out to reinstall it on 5 to 10 machines.

    Being a minor revision, the Setup and Deployment project fails stating that the current version is newer (actually it isn't, but that's the message I get). So, to install the patch, I have to log the person out, log in as an Administrator, remove the current version, install the modified version, log out, and let the other person log back in.

    How can I catch this message box before it displays? I am already overriding the Installer class to allow me to install the application as an Administrator for user accounts with restricted access ...I just can't install because of the minor update.

    Before the install, I would like some code to check what version is actually shown in the Add/Remove Programs settings and compare that to the version I am about to install. If my version is a minor update or greater (String.Compare(strNewVersion, strOldVersion) > 0), display a custom message asking if I'd like that version removed before proceeding. If No, the installation aborts.

    Where is a good place to look for this? Would this involve heavy MSI editing in ORCA, or is this something I could handle in the Installer's constructor? Any tips or ideas? Is there a better forum or different website I should look into? Is this beyond the scope & capabilities of Visual Studio 2008's Setup and Deployment?

    Thanks,
    ~Joe

    Avoid Sears Home Improvement

Todas as Respostas

  • terça-feira, 3 de novembro de 2009 23:09Stephen Cleary Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    I'm not that familiar with the "Setup and Deployment project" in VS. I've converted to WiX some time ago. That said... I believe the Setup project will create a simple bootstrapper (to install .NET and other prerequisites), and then kicks off an MSI file. I think that your Installer code becomes custom .NET actions in that MSI.

    The dialog box you're seeing is thrown up when the MSI gets invoked, which is before your Installer code. So this kind of checking would have to be done by the bootstrapper (e.g., writing your own bootstrapper). Possible but quite difficult.

    The underlying reason is that the fourth version number is ignored by Windows Installer: http://msdn.microsoft.com/en-us/library/aa370859(VS.85).aspx

           -Steve

    Programming blog: http://nitoprograms.blogspot.com/
      Including my TCP/IP .NET Sockets FAQ

    Microsoft Certified Professional Developer
  • quarta-feira, 4 de novembro de 2009 19:06jp2msft Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    I understand the forth version number is ignored by Windows Installer, which is why I'd like to (somehow) determine what the full version number for an installation is.

    Is there a way to say, "Is Product X installed?"

    If so, then ask, "What version of Product X is installed?"

    - Joe

    Avoid Sears Home Improvement
  • quarta-feira, 4 de novembro de 2009 20:09Stephen Cleary Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    MSI exports an API that includes this functionality. I've never used it; it's entirely unmanaged, with no .NET wrappers AFAIK.

            -Steve
    Programming blog: http://nitoprograms.blogspot.com/
      Including my TCP/IP .NET Sockets FAQ

    Microsoft Certified Professional Developer
  • quinta-feira, 5 de novembro de 2009 2:30jp2msft Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    MSI exports an API that includes this functionality. I've never used it; it's entirely unmanaged, with no .NET wrappers AFAIK.

            -Steve

    That's what I would have guessed, and that's one of the things I'd like to learn about on here. Any help with what it is called would be appreciated.
    Avoid Sears Home Improvement