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. General Programming
  3. C#
  4. condition for x64

condition for x64

Scheduled Pinned Locked Moved C#
questionannouncementworkspace
5 Posts 4 Posters 0 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
    mersad00
    wrote on last edited by
    #1

    hi there, im going to run a custom action in a setup proj... its a driver installer which depends on windows platform now i have two version of this driver x64 and x86 ... i know there is a condition properties for detecting platform... but what should i write in it for this reason?

    L D 2 Replies Last reply
    0
    • M mersad00

      hi there, im going to run a custom action in a setup proj... its a driver installer which depends on windows platform now i have two version of this driver x64 and x86 ... i know there is a condition properties for detecting platform... but what should i write in it for this reason?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      What do you mean? This?

      if (IntPtr.Size == 8)
      ; // it's 64bit yay
      else
      ; // it's 32bit :(

      L 1 Reply Last reply
      0
      • L Lost User

        What do you mean? This?

        if (IntPtr.Size == 8)
        ; // it's 64bit yay
        else
        ; // it's 32bit :(

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        I doubt that; there probably is only one installer for all Windows systems, so it is bound to be x86. Testing IntPtr.Size tells about the own process, which would then always return 4. The installer really should be interested in the Windows version, i.e. what sits outside its own boundaries. Unless MS provided something tailored for this in installers, I'd go with WMI. :)

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

        Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

        M 1 Reply Last reply
        0
        • L Luc Pattyn

          I doubt that; there probably is only one installer for all Windows systems, so it is bound to be x86. Testing IntPtr.Size tells about the own process, which would then always return 4. The installer really should be interested in the Windows version, i.e. what sits outside its own boundaries. Unless MS provided something tailored for this in installers, I'd go with WMI. :)

          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

          Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

          M Offline
          M Offline
          mersad00
          wrote on last edited by
          #4

          it wasnt what i need, I need a condition varaible for windows installer, to do a custom action in two way depends on 64bit os or else... like

          memmory>=4000

          i need something to check 64bit like

          64bit=1

          1 Reply Last reply
          0
          • M mersad00

            hi there, im going to run a custom action in a setup proj... its a driver installer which depends on windows platform now i have two version of this driver x64 and x86 ... i know there is a condition properties for detecting platform... but what should i write in it for this reason?

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            I'd start moving away from the Setup and Deployment project in Visual Studio. It won't exist in the next Visual Studio release. The supported method will be InstallShield (Lite or Express or whatever...) Windows Installer has supported x64 component since release 2.0. Normally, I'd create a seperate x64 version of the installer. But, depending on what you're doing, you may be able to do something like adding the x64 components (tagged as such) to a seperate feature, then in a CA, check the VersionNT64 property and make a call to SetFeatureState as appropriate to turn on/off its install state, in the InstallExec sequence. And you don't need any .NET code to do this. You also have to keep in mind a 32-bit installer cannot write to 64-bit registry and file locations...

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak

            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