WIX安装程序:添加POS作为先决条件

在安装.net fx,sql server compact edition等之后,我希望用我的安装程序安装Microsoft POS(服务点)。 我愿意用安装程序提供下载的exe(无需从网上获取)。 我找到了这个链接。链接中的文章表明您需要使用一些参数调用setup。 但我不知道如何做这个Wix明智的。其次,我不确定这是否正确。 (可能需要合并模块?) 有人知道吗?     
已邀请:
Wix生成MSI文件,您无法从MSI内部启动安装程序。如果您找到POS的合并模块,您可以将其包含在您的Wix中。否则,您必须首先使用引导程序来安装POS,然后启动MSI(如DotNetInstaller)。     
我最近在尝试在WiX引导程序中为.NET提供POS时遇到了这个问题。开箱即用的POS for .NET可执行文件不是很有用,特别是当尝试将其作为来自其他安装程序的静默安装提供时。我发现解决此问题的最佳方法是在更友好的自定义自解压可执行文件中为.NET提供POS。这是适合我的解决方案: 运行POS for .NET可执行文件并将文件解压缩到本地目录。 突出显示解压缩目录中的所有文件和文件夹,然后使用WinRAR单击“添加到存档...” 在弹出的窗口中单击“浏览”以选择输出文件将保存到的位置,并将“存档名称”更改为更友好的(可选)。 单击“存档选项”部分下的“创建SFX存档”;单击“确定”,将在指定位置生成可执行文件。 右键单击新的可执行文件,然后选择“使用WinRAR打开”。 单击顶部的SFX图标,然后单击“高级SFX选项”。 在“设置”选项卡下,转到“提取后运行”并输入:   Setup.exe / ADDLOCAL运行时,Posdm   转到“模式”选项卡,确保选中“解压缩到临时文件夹”,并在“静音模式”下选择“全部隐藏”   单击“确定”两次,WinRAR会将您的设置添加到可执行文件中。      按照上述步骤将允许您以“引导程序友好”的方式打包POS for .NET,现在它可以作为ExePackage元素包含在将以静默方式安装的软件包中。 希望这有助于某人。     
如果您无法获得合并模块(这将是首选解决方案,如果该项目由发布者提供),您可以在安装时包含EXE,然后在WiX安装期间将其作为自定义操作执行。 从Tramontana上关于WiX的优秀教程,这里有一个关于自定义操作以及如何设置它们的页面 - 您基本上需要在WiX文件中定义一个
<CustomAction>
元素并指定执行时要执行的操作:
<CustomAction Id='LaunchFile' FileKey='FoobarEXE' ExeCommand='' Return='asyncNoWait' />
这将启动您刚刚作为应用程序的一部分安装的文件,并在您的WiX脚本中引用为
FoobarEXE
<CustomAction Id='LaunchFile' BinaryKey='FoobarEXE' ExeCommand='' Return='asyncNoWait' />
这将引用您包含在WiX安装包(MSI或CAB)中的二进制文件(例如EXE),但该文件未作为安装的一部分安装,并且已被提取为二进制文件。 一旦知道了要做什么,就需要在安装步骤顺序中定义何时执行此自定义操作:
<InstallExecuteSequence>
  ...
  <Custom Action='LaunchFile' After='InstallFinalize'>NOT Installed</Custom>
</InstallExecuteSequence>
在这里,将在安装完成后执行名为
LaunchFile
的自定义操作,但仅在确定尚未安装应用程序时执行。 所以,我想,你应该能够做你正在努力做的WiX自定义动作 - 有关其他信息,请参阅WiX 2.0文档和Steven Bone的博客文章系列。 希望这可以帮助! 渣     
你使用dotnetinstaller,附件是一个示例xml文件。 运行InstallerEditor.exe并打开示例xml文件,根据您的使用进行修改,然后运行InstallerLinker.exe,如下所示: InstallerLinker.exe /Configuration:"c:pathtoyourprod.xml“/输出:”c: work setup.exe“/t:"%DOTNETINSTALLER%%BindotNetInstaller.exe”/ v
<?xml version="1.0" encoding="utf-8"?>
<configurations lcid_type="UserExe" show_language_selector="False" language_selector_title="" language_selector_ok="OK" language_selector_cancel="Cancel" configuration_no_match_message="" ui_level="full" fileversion="" productversion="" log_enabled="True" log_file="#APPPATHYourPackageInstallLog.txt">
  <schema version="1.10.1525.0" generator="dotNetInstaller InstallerEditor" />
  <fileattributes>
    <fileattribute name="FileDescription" value="YourPackage Installer" />
    <fileattribute name="CompanyName" value="MyCompany Design" />
    <fileattribute name="FileVersion" value="%RESOLVEVERSION%" />
  </fileattributes>
  <configuration dialog_caption="YourPackage Installer" dialog_message="In order to install YourPackage you must install these components:" dialog_message_uninstall="" dialog_bitmap="#APPPATHbanner.bmp" skip_caption="Skip" install_caption="Install" uninstall_caption="Uninstall" cancel_caption="Close" status_installed=" (Installed)" status_notinstalled="" failed_exec_command_continue="Failed to install %s. Continue with others components?" installation_completed="YourPackage installed successfully!" uninstallation_completed="YourPackage uninstalled successfully!" installation_none="YourPackage is already installed!" uninstallation_none="YourPackage is not installed!" installing_component_wait="Installing %s. Wait, this operation could take some time ..." uninstalling_component_wait="Uninstalling %s. Wait, this operation could take some time ..." reboot_required="To continue the installation you must restart your computer. Restart now?" must_reboot_required="False" dialog_otherinfo_caption="" dialog_otherinfo_link="" complete_command="" complete_command_silent="" complete_command_basic="" wait_for_complete_command="True" auto_close_if_installed="True" auto_close_on_error="False" reload_on_error="True" dialog_show_installed="True" dialog_show_uninstalled="True" dialog_show_required="True" cab_dialog_message="%s" cab_cancelled_message="" cab_dialog_caption="" cab_path="#TEMPPATH#GUID" cab_path_autodelete="True" dialog_default_button="cancel" dialog_position="" dialog_components_list_position="" dialog_message_position="" dialog_bitmap_position="" dialog_otherinfo_link_position="" dialog_osinfo_position="" dialog_install_button_position="" dialog_cancel_button_position="" dialog_skip_button_position="" auto_start="False" auto_continue_on_reboot="False" reboot_cmd="" show_progress_dialog="True" show_cab_dialog="True" type="install" lcid_filter="" language_id="" language="" os_filter="" os_filter_min="win7" os_filter_max="win7" processor_architecture_filter="" supports_install="True" supports_uninstall="True">
    <component package="#CABPATH%CUDATOOLKITPACKAGE%" cmdparameters="/passive" cmdparameters_silent="/qn" cmdparameters_basic="/" uninstall_package="" uninstall_cmdparameters="/" uninstall_cmdparameters_silent="/qn" uninstall_cmdparameters_basic="/" id="%CUDATOOLKITPACKAGE%" display_name="%CUDATOOLKITPACKAGE%" uninstall_display_name="" os_filter="" os_filter_min="win7" os_filter_max="win7" os_filter_lcid="" type="msi" installcompletemessage="" uninstallcompletemessage="" mustreboot="False" reboot_required="" must_reboot_required="False" failed_exec_command_continue="" allow_continue_on_error="True" default_continue_on_error="False" required_install="False" required_uninstall="False" selected_install="True" selected_uninstall="False" note="" processor_architecture_filter="x64" status_installed="" status_notinstalled="" supports_install="True" supports_uninstall="False" show_progress_dialog="True" show_cab_dialog="True">
      <embedfile sourcefilepath="......Prereqs%CUDATOOLKITPACKAGE%" targetfilepath="%CUDATOOLKITPACKAGE%" />
      <installedcheck path="SOFTWARENVIDIA CorporationGPU Computing ToolkitCUDA" fieldname="VersionsInstalled" fieldvalue="%CUDATOOLKITVERSION%" defaultvalue="False" fieldtype="REG_MULTI_SZ" comparison="contains" rootkey="HKEY_LOCAL_MACHINE" wowoption="WOW64_64" type="check_registry_value" description="Installed Check" />
    </component>
    <component executable="#CABPATH%POSTGRESQLPACKAGE%" executable_silent="" executable_basic="" install_directory="" responsefile_source="" responsefile_target="" responsefile_format="none" uninstall_executable="" uninstall_executable_silent="" uninstall_executable_basic="" uninstall_responsefile_source="" uninstall_responsefile_target="" returncodes_success="" returncodes_reboot="" exeparameters="--mode unattended --unattendedmodeui minimal --servicepassword YourProduct --superpassword YourProduct --superaccount postgres --serviceaccount postgres --debuglevel 4" exeparameters_basic="" exeparameters_silent="" uninstall_exeparameters="" uninstall_exeparameters_basic="" uninstall_exeparameters_silent="" id="%POSTGRESQLPACKAGE%" display_name="%POSTGRESQLPACKAGE%" uninstall_display_name="" os_filter="" os_filter_min="win7" os_filter_max="win7" os_filter_lcid="" type="exe" installcompletemessage="" uninstallcompletemessage="" mustreboot="False" reboot_required="" must_reboot_required="False" failed_exec_command_continue="" allow_continue_on_error="True" default_continue_on_error="False" required_install="False" required_uninstall="False" selected_install="True" selected_uninstall="False" note="" processor_architecture_filter="x64" status_installed="" status_notinstalled="" supports_install="True" supports_uninstall="False" show_progress_dialog="True" show_cab_dialog="True">
      <embedfile sourcefilepath="......Prereqs%POSTGRESQLPACKAGE%" targetfilepath="%POSTGRESQLPACKAGE%" />
      <installedcheck path="SOFTWAREPostgreSQLInstallationspostgresql-x64-9.0" fieldname="Version" fieldvalue="%POSTGRESQLVERSION%" defaultvalue="False" fieldtype="REG_SZ" comparison="version_ge" rootkey="HKEY_LOCAL_MACHINE" wowoption="WOW64_64" type="check_registry_value" description="Installed Check" />
    </component>
    <component executable="#CABPATHvcredist_x64.exe" executable_silent="" executable_basic="" install_directory="" responsefile_source="" responsefile_target="" responsefile_format="none" uninstall_executable="" uninstall_executable_silent="" uninstall_executable_basic="" uninstall_responsefile_source="" uninstall_responsefile_target="" returncodes_success="" returncodes_reboot="" exeparameters="/passive" exeparameters_basic="" exeparameters_silent="" uninstall_exeparameters="" uninstall_exeparameters_basic="" uninstall_exeparameters_silent="" id="vcredist_x64.exe" display_name="vcredist_x64.exe" uninstall_display_name="" os_filter="" os_filter_min="win7" os_filter_max="win7" os_filter_lcid="" type="exe" installcompletemessage="" uninstallcompletemessage="" mustreboot="False" reboot_required="" must_reboot_required="False" failed_exec_command_continue="" allow_continue_on_error="True" default_continue_on_error="False" required_install="False" required_uninstall="False" selected_install="True" selected_uninstall="False" note="" processor_architecture_filter="" status_installed="" status_notinstalled="" supports_install="True" supports_uninstall="False" show_progress_dialog="True" show_cab_dialog="True">
      <embedfile sourcefilepath="C:Program Files (x86)Microsoft SDKsWindowsv7.0ABootstrapperPackagesvcredist_x64vcredist_x64.exe" targetfilepath="vcredist_x64.exe" />
      <installedcheck path="SOFTWAREWow6432NodeMicrosoftVisualStudio10.0VCVCRedistx64" fieldname="Installed" fieldvalue="1" defaultvalue="False" fieldtype="REG_DWORD" comparison="match" rootkey="HKEY_LOCAL_MACHINE" wowoption="WOW64_64" type="check_registry_value" description="Installed Check" />
    </component>
    <component executable="#CABPATH%QUICKTIMEPACKAGE%" executable_silent="" executable_basic="" install_directory="" responsefile_source="" responsefile_target="" responsefile_format="none" uninstall_executable="" uninstall_executable_silent="" uninstall_executable_basic="" uninstall_responsefile_source="" uninstall_responsefile_target="" returncodes_success="" returncodes_reboot="" exeparameters="/passive" exeparameters_basic="" exeparameters_silent="" uninstall_exeparameters="" uninstall_exeparameters_basic="" uninstall_exeparameters_silent="" id="%QUICKTIMEPACKAGE%" display_name="%QUICKTIMEPACKAGE%" uninstall_display_name="" os_filter="" os_filter_min="win7" os_filter_max="win7" os_filter_lcid="" type="exe" installcompletemessage="" uninstallcompletemessage="" mustreboot="False" reboot_required="" must_reboot_required="False" failed_exec_command_continue="" allow_continue_on_error="True" default_continue_on_error="False" required_install="False" required_uninstall="False" selected_install="True" selected_uninstall="False" note="" processor_architecture_filter="" status_installed="" status_notinstalled="" supports_install="True" supports_uninstall="False" show_progress_dialog="True" show_cab_dialog="True">
      <embedfile sourcefilepath="......Prereqs%QUICKTIMEPACKAGE%" targetfilepath="%QUICKTIMEPACKAGE%" />
      <installedcheck path="SOFTWAREApple Computer, Inc.QuickTime" fieldname="Version" fieldvalue="%QUICKTIMEVERSION%" defaultvalue="False" fieldtype="REG_DWORD" comparison="version_ge" rootkey="HKEY_LOCAL_MACHINE" wowoption="WOW64_32" type="check_registry_value" description="Installed Check" />
    </component>
    <component package="#CABPATHYourPackageInstaller.msi" cmdparameters="" cmdparameters_silent="/qn" cmdparameters_basic="/" uninstall_package="" uninstall_cmdparameters="/" uninstall_cmdparameters_silent="/qn" uninstall_cmdparameters_basic="/" id="YourPackageInstaller.msi" display_name="YourPackageInstaller.msi" uninstall_display_name="" os_filter="" os_filter_min="win7" os_filter_max="win7" os_filter_lcid="" type="msi" installcompletemessage="" uninstallcompletemessage="" mustreboot="False" reboot_required="" must_reboot_required="False" failed_exec_command_continue="" allow_continue_on_error="False" default_continue_on_error="False" required_install="True" required_uninstall="True" selected_install="True" selected_uninstall="True" note="" processor_architecture_filter="x64" status_installed="" status_notinstalled="" supports_install="True" supports_uninstall="True" show_progress_dialog="True" show_cab_dialog="True">
      <embedfile sourcefilepath="YourPackageInstaller.msi" targetfilepath="YourPackageInstaller.msi" />
      <installedcheck path="SOFTWAREMyCompany DesignYourProduct YourPackage" fieldname="Version" fieldvalue="%YOURVERSION%" defaultvalue="False" fieldtype="REG_SZ" comparison="version_ge" rootkey="HKEY_LOCAL_MACHINE" wowoption="WOW64_64" type="check_registry_value" description="Installed Check" />
    </component>
  </configuration>
</configurations>
    

要回复问题请先登录注册