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

时间:2009-08-16 13:25:32

标签: installer wix point-of-sale pos-for-.net

我希望在安装.net fx,sql server compact edition等后,使用我的安装程序安装Microsoft POS (Point of service)

我愿意用安装程序提供下载的exe(无需从网上获取)。

我发现了link。链接中的文章表明您需要使用一些参数调用setup。 但是我不知道怎么做这个Wix明智的。其次,我不确定这是否正确。 (可能需要合并模块?)

有人知道吗?

4 个答案:

答案 0 :(得分:4)

Wix生成MSI文件,您无法从MSI内部启动安装程序。如果您找到POS的合并模块,您可以将其包含在您的Wix中。否则,您必须首先使用引导程序安装POS,然后启动MSI(如DotNetInstaller)。

答案 1 :(得分:1)

我最近在尝试在WiX引导程序中为.NET提供POS时遇到了这个问题。开箱即用的POS for .NET可执行文件不是很有用,特别是当尝试将其作为来自其他安装程序的静默安装提供时。我发现解决这个问题的最佳方法是在一个更友好的自定义自解压可执行文件中为.NET提供POS。这是对我有用的解决方案:

  1. 运行POS for .NET可执行文件并将文件解压缩到本地目录。
  2. 突出显示解压缩目录中的所有文件和文件夹,然后使用WinRAR单击“添加到存档...”
  3. 在弹出的窗口中单击“浏览”以选择输出文件将保存到的位置,并将“存档名称”更改为更友好的(可选)。
  4. 点击“存档选项”部分下的“创建SFX存档”;单击“确定”,将在指定位置生成可执行文件。
  5. 右键单击新的可执行文件,然后选择“使用WinRAR打开”。
  6. 单击顶部的SFX图标,然后单击“Advanced SFX Options”。
  7. 在“设置”选项卡下,转到“提取后运行”并输入:

      

    Setup.exe / ADDLOCAL运行时,Posdm

  8.   
  9. 进入“模式”选项卡,确保选中“解压到临时文件夹”,并在“静音模式”下选择“全部隐藏”
  10.   
  11. 单击“确定”两次,WinRAR会将您的设置添加到可执行文件中。
  12.      按照上述步骤将允许您以“引导程序友好”的方式打包POS for .NET,现在它可以作为ExePackage元素包含在将以静默方式安装的软件包中。

    希望这有助于某人。

答案 2 :(得分:0)

如果您无法获得合并模块(这将是首选解决方案,如果该项目由发布者提供),您可以在安装时包含EXE,然后在WiX安装期间将其作为自定义执行动作。

来自Tramontana的excellent tutorial on WiX,这里是一个page on custom actions以及如何设置它们 - 您基本上需要在WiX文件中定义一个<CustomAction>元素并指定当它是什么时候做什么执行:

<CustomAction Id='LaunchFile' FileKey='FoobarEXE' ExeCommand='' Return='asyncNoWait' />

这将启动您刚刚作为应用程序的一部分安装的文件,并在您的WiX脚本中引用为FoobarEXE

<CustomAction Id='LaunchFile' BinaryKey='FoobarEXE' ExeCommand='' Return='asyncNoWait' />

这将引用您包含在WiX安装包(MSI或CAB)中的二进制文件(例如EXE),但该文件未作为安装的一部分安装,并且已被解压缩为二进制文件。 / p>

一旦你知道你将要做什么,你需要定义在安装步骤的顺序中,应该执行这个自定义操作:

<InstallExecuteSequence>
  ...
  <Custom Action='LaunchFile' After='InstallFinalize'>NOT Installed</Custom>
</InstallExecuteSequence>

此处,名为LaunchFile的自定义操作将在安装完成后执行,但仅在确定尚未安装应用程序时执行。

所以,我想,你应该能够做你正在努力做的WiX自定义操作 - 请参阅WiX 2.0 documentationSteven Bone's blog post series以获取更多信息。

希望这有帮助!

马克

答案 3 :(得分:0)

您使用dotnetinstaller,附件是一个示例xml文件。

运行InstallerEditor.exe并打开示例xml文件,根据您的需要进行修改,然后像这样运行InstallerLinker.exe: InstallerLinker.exe /Configuration:"c:\path\to\your\prod.xml“/输出:”c:\ work \ setup.exe“/t:"%DOTNETINSTALLER%%Bin\dotNetInstaller.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="#APPPATH\YourPackageInstallLog.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="#APPPATH\banner.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="/qb-" uninstall_package="" uninstall_cmdparameters="/qb-" uninstall_cmdparameters_silent="/qn" uninstall_cmdparameters_basic="/qb-" 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="SOFTWARE\NVIDIA Corporation\GPU Computing Toolkit\CUDA" 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="SOFTWARE\PostgreSQL\Installations\postgresql-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="#CABPATH\vcredist_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 SDKs\Windows\v7.0A\Bootstrapper\Packages\vcredist_x64\vcredist_x64.exe" targetfilepath="vcredist_x64.exe" />
      <installedcheck path="SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\VC\VCRedist\x64" 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="SOFTWARE\Apple 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="#CABPATH\YourPackageInstaller.msi" cmdparameters="" cmdparameters_silent="/qn" cmdparameters_basic="/qb-" uninstall_package="" uninstall_cmdparameters="/qb-" uninstall_cmdparameters_silent="/qn" uninstall_cmdparameters_basic="/qb-" 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="SOFTWARE\MyCompany Design\YourProduct 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>