问题描述
在我的安装程序设置中,我在用户桌面上创建了指向安装中包含的各种 powershell 脚本的链接。然后我试图确保用户桌面上没有这些脚本的任何副本。我正在使用以下命令创建快捷方式:
<Component Id="cmpSystemServiceDesktopShortcut" Directory="POWERSHELLFOLDER" Guid="{B0892AB8-4D6A-4C23-A099-50A26D9489DF}">
<RegistryValue Id="RegSystemServiceDesktopShortcut"
Root="HKCU"
Key="Software\$(var.rootFolder)\PowerShellScripts"
Name="SystemDesktopSC"
Type="integer"
Value="1"
KeyPath="yes" />
<Shortcut Id="SystemServiceLogShortcut"
Target="[POWERSHELLFOLDER]SystemServiceLog.ps1"
Directory="UserDesktopFolder"
Name="SystemServiceLog"
Description="Shortcut to SystemServiceLog.ps1"
WorkingDirectory="POWERSHELLFOLDER"/>
</Component>
<!-- Remove any existing .ps1 scripts from the User Desktop-->
<Component Id="cmpRemoveUserPowerShellScripts" Directory="UserDesktopFolder" Guid="{0CB106AB-11ED-47A3-8F71-84691F807A29}">
<RemoveFile Id="removeUserPowerShellScripts" On="install" Name="*.ps1"/>
</Component>
<Fragment>
<ComponentGroup Id="PowerShellDesktopShortcuts">
<ComponentRef Id="cmpSystemServiceDesktopShortcut"/>
<ComponentRef Id="cmpRemoveUserPowerShellScripts"/>
</ComponentGroup>
</Fragment>
我的快捷方式创建得很好,但没有从桌面上删除杂散的 .ps1 文件。
我在设置 RemoveFile 命令时遗漏了什么吗?
谢谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)