Performing registry search for a .NET windows installer application

前端 未结 2 1432
情歌与酒
情歌与酒 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: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

提交回复
热议问题