首页 \ 问答 \ WiX MSI在不启动的情况下安装Windows服务(WiX MSI install Windows service without starting it)

WiX MSI在不启动的情况下安装Windows服务(WiX MSI install Windows service without starting it)

我正在尝试为我的Windows服务创建一个将安装该服务的WiX MSI安装程序,但无法启动它。 我似乎无法找到解释如何做到这一点的地方,或者如果可能的话。

我试图删除我用于启动服务的ServiceControl,并且没有任何运气地切换ServiceInstall上的Start属性。 它必须可以做到这一点,对吧? 我只想让MSI文件安装该服务,并让用户在需要时启动它。

<Component Id="ServiceInstaller" Guid="9e578e3d-0339-425c-8633-f54ffaaa4921">

    <ServiceInstall Id="ReportingServiceInstaller"
                    Type="ownProcess"
                    Vital="yes"
                    Name="WindowsService.exe"
                    DisplayName="WindowsService"
                    Description="Wickedly awesome and amazing service."
                    ErrorControl="ignore"
                    Account="NT AUTHORITY\LocalService"
                    Start="auto"
                    Interactive="no" />

    <ServiceControl Id="ServiceControl_Stop"
                    Name="WindowsService.exe"
                    Stop="both"
                    Remove="uninstall"
                    Wait="no" />

</Component>

I am trying to create a WiX MSI installer for my Windows service that will install the service, but not start it. I can't seem to find anywhere that explains how to do this or if it's possible.

I tried to remove the ServiceControl I had for starting the service as well as toggling the Start attribute on the ServiceInstall without any luck. It has to be possible to do this, right? I just want the MSI file to install the service and let the user start it when they want.

<Component Id="ServiceInstaller" Guid="9e578e3d-0339-425c-8633-f54ffaaa4921">

    <ServiceInstall Id="ReportingServiceInstaller"
                    Type="ownProcess"
                    Vital="yes"
                    Name="WindowsService.exe"
                    DisplayName="WindowsService"
                    Description="Wickedly awesome and amazing service."
                    ErrorControl="ignore"
                    Account="NT AUTHORITY\LocalService"
                    Start="auto"
                    Interactive="no" />

    <ServiceControl Id="ServiceControl_Stop"
                    Name="WindowsService.exe"
                    Stop="both"
                    Remove="uninstall"
                    Wait="no" />

</Component>

原文:https://stackoverflow.com/questions/34046837
更新时间:2023-05-10 13:05

最满意答案

UPDATE git 1.8.3引入了一个更有效的方式来获得粗略的大小: git count-objects -vH (见@VonC的回答)

对于“完整尺寸”的不同想法,您可以使用:

git bundle create tmp.bundle --all
du -sh tmp.bundle

关闭(但不准确)

git gc
du -sh .git/

与后者,你也会计数:

  • 挂钩
  • config(遥控器,推送分支,设置(空格,合并,别名,用户详细信息等)
  • 藏匿 (请参阅我可以从远程回收站将藏书藏到本地分支机构中吗? )
  • rerere缓存(可以得到相当大的)
  • reflogs
  • 备份(从过滤器分支,例如)和各种其他事情(中间状态从rebase,平分等)

UPDATE git 1.8.3 introduced a more efficient way to get a rough size: git count-objects -vH (see answer by @VonC)

For different ideas of "complete size" you could use:

git bundle create tmp.bundle --all
du -sh tmp.bundle

Close (but not exact:)

git gc
du -sh .git/

With the latter, you would also be counting:

  • hooks
  • config (remotes, push branches, settings (whitespace, merge, aliases, user details etc.)
  • stashes (see Can I fetch a stash from a remote repo into a local branch? also)
  • rerere cache (which can get considerable)
  • reflogs
  • backups (from filter-branch, e.g.) and various other things (intermediate state from rebase, bisect etc.)

相关问答

更多
  • 回购邮件本身会看到它的大小变化主要是因为数据的性质:二进制数据的存储效率低于非二进制数据,并且通常更大。 使用中的repo(本地克隆)可以看到它的大小取决于最后的gc和repack :请参阅git gc --aggressive vs git repack 。 Packfiles是完成整理的地方 。 至于提交,请阅读“ 完全无视Git提交历史 ”。 这两个极端是查看各个项目的核心变更单位。 从Git的角度来看 - 可能是因为在邮件列表方法中易于使用 - 单个原子提交最有意义。 从GitHub的角度来看,单个 ...
  • 在svn export命令的Git中没有直接的等价物,所以最简单的方法就是制作一个存档并解压缩它。 git archive创建一个ZIP或tar存档,其中只包含存储库的内容而没有任何Git的元数据,因此请创建其中一个并将其解压缩: git archive -o /tmp/repo.tar HEAD cd /your/server/directory tar -xf /tmp/repo.tar rm /tmp/repo.tar 您可以使用-C选项来避免临时文件告诉tar更改目录: git archive - ...
  • UPDATE git 1.8.3引入了一个更有效的方式来获得粗略的大小: git count-objects -vH (见@VonC的回答) 对于“完整尺寸”的不同想法,您可以使用: git bundle create tmp.bundle --all du -sh tmp.bundle 关闭(但不准确) git gc du -sh .git/ 与后者,你也会计数: 挂钩 config(遥控器,推送分支,设置(空格,合并,别名,用户详细信息等) 藏匿 (请参阅我可以从远程回收站将藏书藏到本地分支机构中吗 ...
  • 合并不会删除历史记录。 特别: 你开始 C -- D -- E -- F <--(develop) 在A和B中都做了一些清理。你没有指定你做了什么,但是假设你最终得到了类似 C -- E' -- F' <--(develop) 在A.(我假设C没有变化,否则你的合并尝试会抱怨,你不得不使用--allow-unrelated-histories选项。) 然后在B ,假设你只是运行git fetch 。 你会有的 C -- D -- E -- F <--(develop) \ E' -- F' <-- ...
  • 从来没有试过这个,但也许操纵bridge-repo的/.hg中的git-mapfile可以工作。 我会这样尝试: 让我们说Hg repo的提示是Git repo的根。 通过hg-git克隆Git repo只到root(这可能与Git一致,对吧?)。 将所有提交从原始Hg repo中拉入hg-git克隆。 去除单根,但记下这个根的完整哈希值。 记下Hg repo提示的完整哈希值(现在也是hg-git克隆的提示)。 编辑/.hg/git-mapfile。 它应该只包含一个条目,一边是单根的哈希(应该在右边)。 ...
  • 我已通过在服务器中运行以下命令解决了它。 bash git gc --aggressive --prune=now I have resolved it by run below command in server. bash git gc --aggressive --prune=now
  • 如果在执行第一个命令时没有初始化repo,则错误消息是正常的:您需要在添加任何远程之前创建一个repo。 至于你的第二个错误信息:如果你在git repo目录本身(你在git init ),那么,作为Issac注释,你不需要--git-dir参数。 但是如果你仍然想添加一个--git-dir参数,那么--git-dir为非裸存储库引用的路径必须以/.git (就像你在第一个命令中所做的那样)。 即使在~/gitRepo/my_repo创建了一个git repo: ~/gitRepo/my_repo不是git ...
  • Heroku不是GitHub的替代品(当然没有社交功能,拉取请求,fork队列,评论和对提交的评论......)。 另外我认为它不支持智能http (当你在企业防火墙后面推动时这很重要)。 它不支持子模块 ( GitHub ) 但它适用于管理和部署Web应用程序,并具有高级监控功能 。 如果是你的情况,那么Heroku是正确的选择。 Heroku isn't a replacement for GitHub (and certainly don't have all the social feature, ...
  • 您可以为每个存储库配置pack.threads,但我怀疑是否有自动执行此操作的设置,具体取决于存储库的大小。 You can configure pack.threads per repository, but I doubt that there is a setting to do this automatically depending on the size of the repository.
  • 重置为HEAD : git reset --hard HEAD 清理掉任何遗留下来的东西: git clean -fxd 请注意, 这两个命令都可以删除信息并丢失状态。 如果您丢失了某些内容,请务必进行备份。 Reset to HEAD: git reset --hard HEAD Clean out anything else left behind: git clean -fxd Be warned that both of these commands can delete informati ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)