Romanitho / Winget-AutoUpdate

WAU daily updates apps as system and notify connected users. (Allowlist and Blocklist support)
MIT License
1.13k stars 140 forks source link

MSI installer - redundancy in public properties #739

Open AndrewDemski-ad-gmail-com opened 1 day ago

AndrewDemski-ad-gmail-com commented 1 day ago

https://github.com/Romanitho/Winget-AutoUpdate/blob/a63a3957978a14941f0b318afe9052d4988b84cd/Sources/Wix/build.wxs#L26

We are expanding the POWERSHELLEXE property during AppSearch action, but we are not using it later and we end up with those two little monsters: https://github.com/Romanitho/Winget-AutoUpdate/blob/a63a3957978a14941f0b318afe9052d4988b84cd/Sources/Wix/build.wxs#L254-L255

Shouldn't it be consistent/reused?

reference (using file Id for ps1 script): https://stackoverflow.com/questions/14045955/run-powershell-script-from-wix-installer

Romanitho commented 1 day ago

I did this because of the Sysnative command. But perhaps it can be done differently.

AndrewDemski-ad-gmail-com commented 1 day ago

I did this because of the Sysnative command. But perhaps it can be done differently.

You are right, msi file produed by wix uses Wix4UtilCA_X86.dll which suggests x86 context. sysnative must stay. image

It somehow skipped my attention.

AndrewDemski-ad-gmail-com commented 1 day ago

After some digging I found that: https://wixtoolset.org/docs/tools/wixext/quietexec/#architecture-specific-custom-action-dlls

The $(sys.BUILDARCHSHORT) preprocessor variable contains the suffix you need for the custom action DLL id based on the architecture of the package you're building. For example, you can use BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)" in your CustomAction authoring.

There is an example of how CA XML node should look like. I think that it will remove the dependency for sysnative usage..

..at least according to that documentation: https://wixtoolset.org/docs/tools/wixext/quietexec/#64-bit-awareness