如何合并Msi包和.net4.8版本并生成Msi包

hgqdbh6s  于 2022-12-14  发布在  .NET
关注(0)|答案(2)|浏览(121)

I have a requirement to Merge/bundle Msi package with .Net 4.8 executable package and generate MSI package as an output.
I have currently written a Bootstrapper application in wix that generates .exe file, which also has an install condition for .Net 4.8
But the requirement is to generate MSI after bundling

8i9zcol2

8i9zcol21#

I would say that this is not a good way to do it.
Bring out .net first and then install your msi in another step.
Merging 2 installations in one msi would require you to make a snapshot into a new msi, and therefore you would loose the intelligence of the already built .net installation.
You "could" make a custom action in your msi which installs the .net, but nested installs are deprecated and i dont know if it would really work these days. I never done it.

ztigrdn8

ztigrdn82#

Add a Custom Action like a power shell script Before InstallFiles

<InstallExecuteSequence>
            <Custom Action="AddNetFramework" Before="InstallFiles"><![CDATA[NOT Installed]]></Custom>               
</InstallExecuteSequence>

Put the action in InstallExecuteSequence
Some helpers

<!-- Get PowerShell exe path -->
        <Property Id="POWERSHELLEXE">
            <RegistrySearch Id="POWERSHELLEXE"
                Type="raw"
                Root="HKLM"
                Key="SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell"
                Name="Path" />
        </Property>

<CustomAction Id="AddNetFramework" Property="AddPSProfie" Value="&quot;[POWERSHELLEXE]&quot; -File &quot;[FOLDER]Scripts\InstallFrwk.ps1&quot; &quot;[FOLDER]Scripts&quot;" Execute="immediate" />

Considering your powershell file and ndp48-x86-x64-allos-enu.exe is in location /Scripts
Add a fragment for copying file and Compressed="yes" in the <Package>

相关问题