Performing registry search for a .NET windows installer application

前端 未结 2 1426
情歌与酒
情歌与酒 2021-01-23 08:30

I have a .NET winform installer application. Before installing, I\'m doing a registry search to check if MS Access Runtime is installed on the machine.

Search Target Mac

相关标签:
2条回答
  • 2021-01-23 08:45

    So this is how i finally got this to work and tested successfully on both 32bit and 64bit Windows machines.

    My application is dependent on two prerequisites. 1. Crystal Report Runtime. 2. Microsoft Access Runtime.

    So created registry search for both the runtimes.

    And Properties for each of the Search created.

    Launch Condition for each of the runtimes.

    If you observe between the two conditions for each of the runtime you would find the difference in the way the condition has been set.

    For Microsoft Access Runtime, i have just mentioned the Property name that was set for the Registry Search. While for Crystal Report Runtime, i have specified the value which is a specific version of runtime that should be present. In my case i was specifically looking for version "13.0.4" to be present on the machine.

    0 讨论(0)
  • 2021-01-23 08:53

    Correct Registry Search: Try to search the proper 32-bit section of the registry: SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths\MSACCESS.EXE

    Crucial is the inclusion of Wow6432Node towards the beginning of the string.


    Custom Action: It is not accepted best practice, but I like to use custom actions to inspect the system (I don't like them for making system updates). Inspection custom actions are read-only, do not require any rollback, are not dangerous to the system and you can relatively safely suppress errors.

    The reason I like inspection custom actions is that you have full flexibility if system inspection requirements get more complicated. I find AppSearch gets very confusing at times. Custom actions are not easy to use with Visual Studio Installer Projects.


    Bitness: I don't use App Search much, but is this an actual 32-bit machine (pretty vintage that) or a 64-bit machine with 32-bit components? In case of the latter, here is a reminder about the core bitness-dependent paths in the registry and on disk:

    Registry:

    • 64-Bit: HKEY_LOCAL_MACHINE\SOFTWARE
    • 32-Bit: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node

    Disk:

    • 64-Bit: C:\Program Files\
    • 32-Bit: C:\Program Files (x86)\
    • 64-Bit: C:\Windows\System32\ - (yes, really)
    • 32-Bit: C:\Windows\SysWOW64\ - (yes, really)

    Links:

    • App Search - registry locations
    0 讨论(0)
提交回复
热议问题