How to define installation folder from command line parameter in Wix installer

自闭症网瘾萝莉.ら 提交于 2019-12-05 11:54:38
Christopher Painter
<Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="CompanyFolder" Name="CompanyName">
                <Directory Id="INSTALLLOCATION" Name="Application Launcher">
                    <Component Id="ApplicationFiles" Guid="*">
                        <File Name="app.exe" Id="AppFile1" Source="app.exe" Vital="yes" />
                    </Component>
                </Directory>
            </Directory>
        </Directory>
</Directory>

For your install:

msiexec /I setup.msi INSTALLLOCATION=C:\Somewhere /qn
Stein Åsmul

I am adding as an answer to get proper links. You should check out Wix's auto-generate GUID feature: WIX Autogenerate GUID *?

This feature allows you to stop generating your own GUIDs and have Wix take care of them in an "automagic" way. I haven't tested it, but anything that makes your source file cleaner, shorter, and easier to maintain is worth trying. It also makes it easier to share Wix snippets without people reusing your generated GUID.

Maybe also check out:

And one more thing with regards to properties. In general all PUBLIC properties (uppercase) can be set on the command line. If you want to use these properties in deferred mode custom actions you need to check out the concept of restricted public properties and the SecureCustomProperties property. Some Installshield info too. And a nice old Wise article.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!