Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Clever Code
  4. What's inside a package?

What's inside a package?

Scheduled Pinned Locked Moved Clever Code
helpcsharpvisual-studiosysadminhardware
6 Posts 5 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mav northwind
    wrote on last edited by
    #1

    While I was preparing one of our C# applications to play more nicely with Vista, I came across a quite unexpected behaviour of VS (2003 in our case, didn't check with 2005 yet). In order for the application to demand elevated user rights, I embedded a manifest into the executable by calling a tool (ManifestInjector) during a post-build action. As target file to inject the manifest into I gave $(TargetPath) and, as I expected, the manifest was injected into ...\bin\Release\MyApp.exe. I also have a Setup&Deployment project for this application. In this project I wanted the primary output from the application project to be wrapped into a nice installer package. Because nothing changed in this project, I assumed that the - now manifest-bearing - executable would be included in the setup. I was wrong. Setup was built as usual, I got the output from ManifestInjector telling me that the manifest was included successfully, I tried installing the application under Vista, everything went fine, until I actually ran the application for the first time. There was no dialog requesting admin rights, the app came up just like it did before. Strangely, the executable didn't show the little shield icon you get for applications demanding elevated rights. So I compared the modification date and size of this executable with the one I had in my bin\release folder. They were identical. I copied over the executable from the bin\release folder and this copy did show the shield icon! :wtf: After a while I found out what was happening: I don't know why the engineers at MS decided to go this way, but actually you get the executable from ...\**obj**\Release included in the msi file when you tell VS you want the primary output. Knowing this it was very easy to fix the problem by embedding the manifest into the ...\obj\Release\MyApp.exe file, but if you don't look very carefully it's easy for such a bug to slip through.

    Regards, mav -- Black holes are the places where God divided by 0...

    S S 2 Replies Last reply
    0
    • M mav northwind

      While I was preparing one of our C# applications to play more nicely with Vista, I came across a quite unexpected behaviour of VS (2003 in our case, didn't check with 2005 yet). In order for the application to demand elevated user rights, I embedded a manifest into the executable by calling a tool (ManifestInjector) during a post-build action. As target file to inject the manifest into I gave $(TargetPath) and, as I expected, the manifest was injected into ...\bin\Release\MyApp.exe. I also have a Setup&Deployment project for this application. In this project I wanted the primary output from the application project to be wrapped into a nice installer package. Because nothing changed in this project, I assumed that the - now manifest-bearing - executable would be included in the setup. I was wrong. Setup was built as usual, I got the output from ManifestInjector telling me that the manifest was included successfully, I tried installing the application under Vista, everything went fine, until I actually ran the application for the first time. There was no dialog requesting admin rights, the app came up just like it did before. Strangely, the executable didn't show the little shield icon you get for applications demanding elevated rights. So I compared the modification date and size of this executable with the one I had in my bin\release folder. They were identical. I copied over the executable from the bin\release folder and this copy did show the shield icon! :wtf: After a while I found out what was happening: I don't know why the engineers at MS decided to go this way, but actually you get the executable from ...\**obj**\Release included in the msi file when you tell VS you want the primary output. Knowing this it was very easy to fix the problem by embedding the manifest into the ...\obj\Release\MyApp.exe file, but if you don't look very carefully it's easy for such a bug to slip through.

      Regards, mav -- Black holes are the places where God divided by 0...

      S Offline
      S Offline
      Super Lloyd
      wrote on last edited by
      #2

      mav.northwind wrote:

      Black holes are the places where God divided by 0...

      good one! :-D

      I 1 Reply Last reply
      0
      • S Super Lloyd

        mav.northwind wrote:

        Black holes are the places where God divided by 0...

        good one! :-D

        I Offline
        I Offline
        ingo ahrens
        wrote on last edited by
        #3

        Super Lloyd wrote:

        mav.northwind wrote: Black holes are the places where God divided by 0... good one!

        God can't divide by zero, but Chuck Norris can!

        P 1 Reply Last reply
        0
        • I ingo ahrens

          Super Lloyd wrote:

          mav.northwind wrote: Black holes are the places where God divided by 0... good one!

          God can't divide by zero, but Chuck Norris can!

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Not true - God Divided by zero and Chuck Norris was the result.

          Please visit http://www.readytogiveup.com/ and do something special today. Deja View - the feeling that you've seen this post before.

          S 1 Reply Last reply
          0
          • P Pete OHanlon

            Not true - God Divided by zero and Chuck Norris was the result.

            Please visit http://www.readytogiveup.com/ and do something special today. Deja View - the feeling that you've seen this post before.

            S Offline
            S Offline
            Sathesh Sakthivel
            wrote on last edited by
            #5

            :laugh:

            Regards, Satips.:rose: Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Walk beside me, and just be my friend. - Albert Camus

            1 Reply Last reply
            0
            • M mav northwind

              While I was preparing one of our C# applications to play more nicely with Vista, I came across a quite unexpected behaviour of VS (2003 in our case, didn't check with 2005 yet). In order for the application to demand elevated user rights, I embedded a manifest into the executable by calling a tool (ManifestInjector) during a post-build action. As target file to inject the manifest into I gave $(TargetPath) and, as I expected, the manifest was injected into ...\bin\Release\MyApp.exe. I also have a Setup&Deployment project for this application. In this project I wanted the primary output from the application project to be wrapped into a nice installer package. Because nothing changed in this project, I assumed that the - now manifest-bearing - executable would be included in the setup. I was wrong. Setup was built as usual, I got the output from ManifestInjector telling me that the manifest was included successfully, I tried installing the application under Vista, everything went fine, until I actually ran the application for the first time. There was no dialog requesting admin rights, the app came up just like it did before. Strangely, the executable didn't show the little shield icon you get for applications demanding elevated rights. So I compared the modification date and size of this executable with the one I had in my bin\release folder. They were identical. I copied over the executable from the bin\release folder and this copy did show the shield icon! :wtf: After a while I found out what was happening: I don't know why the engineers at MS decided to go this way, but actually you get the executable from ...\**obj**\Release included in the msi file when you tell VS you want the primary output. Knowing this it was very easy to fix the problem by embedding the manifest into the ...\obj\Release\MyApp.exe file, but if you don't look very carefully it's easy for such a bug to slip through.

              Regards, mav -- Black holes are the places where God divided by 0...

              S Offline
              S Offline
              Sathesh Sakthivel
              wrote on last edited by
              #6

              mav.northwind wrote:

              Black holes are the places where God divided by 0...

              Nice One.

              Regards, Satips.:rose: Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Walk beside me, and just be my friend. - Albert Camus

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups