- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我有一个简单的“Hello world”windows 窗体应用程序(在 VS-2013 中创建)。
如何使用 WIX 工具集在 Windows 启动时启动应用程序?
必须在 windows7 和 windows8 中工作。
这是我目前拥有的 Product.wxs。
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Installer" Language="1033" Version="1.0.0.0" Manufacturer="DMC" UpgradeCode="808c333f-09f7-45d5-a5ab-ea104c500f2b">
<Package Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="Installer" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="HelloWorld" />
</Directory>
<Directory Id="StartupFolder">
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Guid="{A4744AE7-211C-42A0-887D-1701D242776C}">
<File Source="$(var.HelloWorld.TargetPath)" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
编辑:
感谢您的帮助,但对我来说还不够好。在哪里添加这个标签?我应该创建快捷方式,还是 wix 会为我创建快捷方式?我是否必须包括 wix 的快捷方式,以及如何?我是否必须将 .ico 添加到 Wix 项目中以及如何添加? 我需要一步一步的解释来理解这一点。 Hello World 项目示例的 Whole Product.wxs 将是最好的。
编辑2:
我仍然不知道如何用 wix 解决这个问题。我使用了不同的方法:How to run a C# application at Windows startup?
最佳答案
我还没有时间在家里的 Wix Directory 项目中测试结构,但从我的头顶看,目录结构应该是这样的
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" .. >
<Component ... >
<File ... >
<Shortcut Id=".." Directory="StartupFolder" ...>
<Icon ... />
</Shortcut>
</File>
</Component>
</Directory>
<!-- ADD THIS -->
<Directory Id="StartupFolder" ...>
<Directory Id="MyShortcutFolder" ... />
</Directory>
</Directory>
</Directory>
**更新**
默认情况下,包含目录结构的片段紧跟在产品元素之后。
在声明安装所需目录结构的片段中,您将添加对 Windows 下启动文件夹的目录引用。
之后,您必须创建一个组件,该组件将指示它获取一个文件并在您作为引用传递的目录(启动文件夹)中创建一个快捷方式。
当安装程序启动时,它会将快捷方式复制到您引用的目录中指定的文件。
** 来自您的来源 **
在包含您的产品组件的片段中添加此声明
<DirectoryRef Id="StartupFolder">
<Component Id="ApplicationShortCutStartUp" Guid="{BCC2E481-53AF-4690-912D-1051B930B910}">
<Shortcut Id="AppShortCutStartUp" Name="DMC"
Description="DMC HELLO"
Target="[INSTALLDIR][[ NAME OF YOUR EXE]]"
WorkingDirectory="INSTALLDIR" />
<RegistryKey Root="HKLM" Key="DMC\HelloWorld" Action="createAndRemoveOnUninstall">
<RegistryValue Name="ShortCutStartUp" Type="integer" Value="1" KeyPath="yes" />
</RegistryKey>
</Component>
</DirectoryRef>
在产品下的功能标签中添加对新组件的引用所以现在您的产品声明将如下所示
<Product Id="*" Name="Installer" Language="1033" Version="1.0.0.0" Manufacturer="DMC" UpgradeCode="808c333f-09f7-45d5-a5ab-ea104c500f2b">
<Package Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="Installer" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="ApplicationShortCutStartUp" />
</Feature>
</Product>
这将为您的机器复制一个快捷方式到您的启动文件夹。
调整
这个:
<ComponentGroupRef Id="ApplicationShortCutStartUp" />
应该是
<ComponentRef Id="ApplicationShortCutStartUp" />
这个:
<!-- ADD THIS -->
<Directory Id="StartupFolder" ...>
<Directory Id="MyShortcutFolder" ... />
</Directory>
应该是:
<Directory Id="StartupFolder" ...>
</Directory>
这应该可以解决你的两个错误
关于xml - 如何: Making a program start on Windows startup with wix toolset?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28305179/
我试图在 GCE 上启动时让以下脚本在 CentOS 实例上运行。 我在实例名称上设置了自定义元数据“启动脚本”,并将以下脚本作为值。 该脚本不会在启动、重启或运行/usr/share/google/
我在我的一个类中添加了一个 startUp-Method,它立即退出了我的图像。有没有办法阻止 Photo 执行该方法以便我可以修复它? 最佳答案 不,这是一个持续讨论的问题。见 this post在
我在启动类中收到“'Startup.Configuration' 和'Startup.Configuration' 之间的歧义”错误。我不知道我做了什么导致这个问题。我所做的只是创建了一个 DBCon
asp.net 5 中的 Startup 类让我觉得很奇怪。它不是类 Startup : ISomething 或 Startup : BaseSomething ,其中接口(interface)或基
我有这个代码: https://github.com/nbarbettini/SimpleTokenProvider/tree/master/test/SimpleTokenProvider.Test
这个问题在这里已经有了答案: What does the servlet value signify (11 个答案) 关闭 7 年前。 考虑到同样的问题,我是 J2EE 的新手,请回答。当我们使
关闭。这个问题是opinion-based .它目前不接受答案。 想改进这个问题?更新问题,以便 editing this post 提供事实和引用来回答它. 8年前关闭。 Improve this
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
如何以编程方式查找在设备启动时启动的应用程序列表。有什么方法可以以编程方式禁用您不需要的自动启动应用程序。 谢谢 最佳答案 除了删除有问题的应用程序之外,别无他法。 API 表示系统必须接受对 BOO
我知道它们用于调用 main(),但如果那是唯一目的,那么拥有不同的 crt 文件有什么意义。为什么不使用默认的而不是创建自己的? 最佳答案 CRT 文件是 C 运行时文件。您最有可能遇到的是 crt
我正在运行一个带有在重启时调用的启动脚本的 EC2 实例。此启动脚本在启动容器之前检查 docker 守护进程是否正在运行,但失败并显示错误:Post http:///var/run/docker.s
我有一个项目,其中包含许多具有自己的日志记录的“工具”类。这些日志文件是在应用程序启动时创建的,但在使用之前一直为空。 是否可以告诉logback在启动时不应该创建空文件?但是仅在使用它们时? 不知何
我正在尝试创建自己的自定义钻取功能,其中 URL dynamics://0?myfunction_123456 将启动我自己的代码。 在 C\SysStartupCmd\construct 中,这个基
我有一个 RFID 模块连接到我的 beaglebone 并使用 python 代码读取 ID 标签。现在,我希望我的 python 代码在没有任何命令的情况下登录我的 beaglebone 时直接在
我试图探索一些 ASP.NET-5 应用程序,我在其中找到了 startup.cs 文件。我们在这里设置路由和所有(当然不仅仅针对路由)。我还看到一些演示,其中显示了依赖注入(inject)的使用 h
我遇到以下问题。我有一个带有 UI、nib 等的 Cocoa 应用程序。我需要能够在后台或前台启动该应用程序。换句话说,我需要前者中的 NSApplicationActivationPolicyPro
我在 Windows 上,根据 this startup.el 用于emacs 的启动。但是当我在这个文件中设置代码时(C:\Users\frountch\Progs\emacs24\share\em
asp.net mvc 6 beta5 我尝试使用 config.json 来激活\禁用日志记录 public IConfiguration Configuration { get; set; } p
我一直在查看 ASP.NET Web API 默认项目,它带有 ASP.NET Identity 身份验证,它使用 Owin。我在谷歌上搜索了一下,发现 Owin 旨在将应用程序与服务器分离,并且它的
我是一名优秀的程序员,十分优秀!