开发者

Wix Shortcut Arguments Issues

开发者 https://www.devze.com 2023-03-07 12:11 出处:网络
I have a strange issue with Wix I\'m creating a shortcut to a config tool for a windows service. I want to pass the config file for the windows service as an argument to the config tool.

I have a strange issue with Wix

I'm creating a shortcut to a config tool for a windows service.

I want to pass the config file for the windows service as an argument to the config tool.

Thus I have a component that installs the windows service, this works fine and another one that installs the config tool.

The shortcut code is below:

            <Shortcut Id="LaunchConfigTool" WorkingDirectory="WINDOWSSERVICE" Arguments="[#fil21620445E80831C7F56986614D268A22]" 
                      Name="Service Configuration Tool" Directory="ProgramMenuDir" Advertise="yes"/>
          </File>

This does not work, namely, the shortcut fails to launch the config tool. However, the snippet below works fine. Needless to say that the reference above refers to service.exe.config.

            <Shortcut Id="LaunchConfigTool" WorkingDirectory="WINDOWSSERVICE" Arguments="service.exe.config" 
                      Name="Service Configuration Tool" Directory="ProgramMenuDir" Advertise="yes"/>
          </File>

I logged the installer actions to a file and both have the following output

    MSI (s) (BC:1C) [11:32:27:947]: Executing op: ShortcutCreate(Name=tcet7-ht|Service Configuration Tool,Feature=ProductFeature,Component={B9ED30DE-087D-393E-950B-C67877E51B8A}[~]2,,Arguments=C:\Program Files\Housekeeping\Windows Service\service.exe.config,WorkingDir=C:\Program Files\Housekeeping\Windows Service\,,,,,,,,,)

Any ideas with the reference is not working?

TI开发者_如何学JAVAA


Try enclosing the argument in quotes:

Arguments="&quot;[#fil21620445E80831C7F56986614D268A22]&quot;"

During installation your argument will be resolved to a path which may contain spaces. This type of paths need to be enclosed in quotes in order to be recognized correctly.

0

精彩评论

暂无评论...
验证码 换一张
取 消