[英]WiX silent install unable to launch built in .EXE: WiX v3
我知道這似乎是重復的,但我幾乎在線嘗試了所有方法,包括以下鏈接:
使用雙擊時,安裝成功完成,並且啟動我的EXE,這是WPF UI。
問題是,如果在命令行中運行,則會安裝WiX安裝程序,但我的WPF無法啟動。 沒有驅動程序更新。 請注意,我有自定義開關,例如/?。 在我的WPF中/ q / forerestart / noreboot。
安裝后啟動,沒有用戶界面嗎? http://wixtoolset.org/documentation/manual/v3/howtos/ui_and_localization/run_program_after_install.html
這是我的下面的代碼
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"><?define INF_INSTALLER_TargetDir=$(var.INF_INSTALLER.TargetDir)?>
<Product Id="guid here" Name="INF_INSTALLER" Language="1033" Version="1.1.1.3" Manufacturer="Intel Corporation" UpgradeCode="guid here">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<!--User Agrrement-->
<WixVariable Id="WixUILicenseRtf" Value="$(var.ProjectDir)EULAsingleuselicense.rtf" />
<WixVariable Id="WixUIBannerBmp" Value="images\Banner.jpg" />
<WixVariable Id="WixUIDialogBmp" Value="images\Background.png" />
<!--Chosing the UI version-->
<!-- Step 2: Add UI to your installer / Step 4: Trigger the custom action -->
<!-- UI to installer -->
<UI>
<UIRef Id="WixUI_Minimal" />
<!-- Launch the applicaiton -->
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">NOT Installed</Publish>
</UI>
<!--<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch INF INSTALLER" /> -->
<!-- Step 3: Include the custom action -->
<Property Id="WixShellExecTarget" Value="[#INF_INSTALLER.exe]" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<Feature Id="ProductFeature" Title="INF INSTALLER" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id="ApplicationShortcut" />
<!--<ComponentRef Id="ApplicationShortcutDesktop" /> -->
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="TempFolder">
<Directory Id="ManufacturerFolder" Name="INF_INSTALLER">
<Directory Id="INSTALLFOLDER" Name="INF_INSTALLER" />
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="!(bind.property.ProductName)" />
</Directory>
<!--<Directory Id="DesktopFolder" Name="Desktop" />-->
</Directory>
</Directory>
</Fragment>
<Fragment>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="guid here">
<Shortcut Id="ApplicationStartMenuShortcut" Name="!(bind.property.ProductName)" Description="INF INSTALLER" Target="[INSTALLFOLDER]INF_INSTALLER.exe" WorkingDirectory="INSTALLFOLDER" />
<RemoveFolder Id="RemoveApplicationProgramsFolder" Directory="ApplicationProgramsFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\INF_INSTALLER" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
<!--<DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationShortcutDesktop" Guid="guid here">
<Shortcut Id="ApplicationDesktopShortcut" Name="!(bind.property.ProductName)" Description="INF INSTALLER" Target="[INSTALLFOLDER]INF_INSTALLER.exe" WorkingDirectory="INSTALLFOLDER" />
<RemoveFolder Id="RemoveDesktopFolder" Directory="DesktopFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\INF_INSTALLER" Name="InstalledCompleted" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>-->
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="windowscert.cer" Guid="guid here">
<File Id="windowscert.cer" Name="windowscert.cer" Source="$(var.INF_INSTALLER_TargetDir)windowscert.cer" />
</Component>
<Component Id="myinf.inf" Guid="guid here">
<File Id="myinf.inf" Name="myinf.inf" Source="$(var.INF_INSTALLER_TargetDir)myinf.inf" />
</Component>
<Component Id="INF_INSTALLER.exe" Guid="guid here">
<File Id="INF_INSTALLER.exe" Name="INF_INSTALLER.exe" Source="$(var.INF_INSTALLER_TargetDir)INF_INSTALLER.exe" />
</Component>
<Component Id="INF_INSTALLER.exe.config" Guid="guid here">
<File Id="INF_INSTALLER.exe.config" Name="INF_INSTALLER.exe.config" Source="$(var.INF_INSTALLER_TargetDir)INF_INSTALLER.exe.config" />
</Component>
<Component Id="INF_INSTALLER.pdb" Guid="guid here">
<File Id="INF_INSTALLER.pdb" Name="INF_INSTALLER.pdb" Source="$(var.INF_INSTALLER_TargetDir)INF_INSTALLER.pdb" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<CustomAction Id="LaunchFile" FileKey="INF_INSTALLER.exe" ExeCommand="/quiet" Return="asyncNoWait" />
<Property Id="WixSilentExecCmdLine" Value="/silent" Hidden="yes"/>
<CustomAction Id="SilentExecExample" BinaryKey="WixCA" DllEntry="WixSilentExec" Execute="immediate" Return="check"/>
<InstallExecuteSequence>
<Custom Action="LaunchFile" After="InstallFinalize">NOT Installed</Custom>
<Custom Action="SilentExecExample" After="TheActionYouWantItAfter"/>
<RemoveExistingProducts After="InstallFinalize" />
</InstallExecuteSequence>
</Fragment>
</Wix>
配置錯誤 :無論靜默或交互模式如何,此行都將永遠不會運行:
<Custom Action="SilentExecExample" After="TheActionYouWantItAfter"/>
After屬性必須指定一個有效的StandardAction或CustomAction名稱。
靜默模式失敗 :由於您在InstallFinalize
之后運行它,因此以下行將在靜默模式下失敗。 在這種情況下,它將不會隨着海拔升高而運行(除非您從提升的cmd.exe
提示符啟動安裝程序),並且因此無法完成安裝(安裝過程僅在InstallExecuteSequence
中的InstallInitialize
和InstallFinalize
之間升高運行):
<Custom Action="LaunchFile" After="InstallFinalize">NOT Installed</Custom>
您還應該了解幾件事。 請閱讀以下內容。
Windows Update分發 :記錄下來,Microsoft似乎希望將來通過Windows Update或至少通過獨立的軟件包分發驅動程序,而無需安裝程序。
從Windows 10版本1607開始:
Hardware certification
Collaborative driver development
Driver distribution through Windows Update
驅動程序元素 :WiX當前具有用於安裝驅動程序的驅動程序元素 。 據我所知,它在后台使用了DIFx框架。 可以在github.com上找到一個小而實用的示例 。 我從未使用過此功能。 FireGiant的WiX擴展包具有更高級的驅動程序安裝支持。 從來沒有嘗試過我。
DPInst.exe :我不熟悉INF_INSTALLER.exe
是您創建的專有組件嗎? 也可以使用DIFx框架中的DPInst.exe
工具安裝簽名的驅動程序。 它可以通過MSI內部的自定義操作來調用,也可以直接從Burn(WiX Bundle-換句話說,不是MSI的一部分)運行。 可以在github.com上找到一個相當簡短的示例 。
小提示 :搜索"DPInst.exe http://schemas.microsoft.com/wix/2006/wi"
將產生大量匹配。 根據我的經驗,您可以使用此github搜索技術查找有關任何內容的幫助。 不過請務必謹慎,我會利用節省的時間進行額外的測試。 只是我的2美分。
一些鏈接 :
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.