我创建了安装程序,需要删除一些文件和文件夹(如果它们已经存在)并替换为新的。
当用户单击安装时,安装程序会提示输入 UAC。选择“是”后,安装程序将调用删除现有文件和文件夹的方法。但它无法删除文件和文件夹。我使用的代码是 DI.Delete(path)。它给出了这个错误
Access to the path 'CodeCreate.aspx' is denied.
at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive)
at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive)
at System.IO.DirectoryInfo.Delete(Boolean recursive)
at CustomizationCA.CustomActions.DeleteExistingFilesAndFolder(Session session)
Run Code Online (Sandbox Code Playgroud)
如果我以管理员身份运行命令提示符,然后使用“msiexec /i Setup.msi”命令,它会删除这些文件和文件夹。
当使用 Directory.Delete(path,true); 时 我将此视为例外
Exception thrown by custom action:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.
at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean …Run Code Online (Sandbox Code Playgroud) 这是我的情况:
我有 VS2010 解决方案,其中包含 X 项目。
Wix 项目可以从所有编译的工件创建 msi。
我有构建机器\ Jenkins,首先编译(MSBuild .Net 4)所有解决方案,然后编译wix以将其打包到msi。
我如何将产品编号(例如 11.2.0.4789)注入到所有工件\dll中 - 尽可能简单?
编译解决方案时是否可以传递命令行参数?
这是我的代码:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define ProductName = "MyApp"?>
<?define ProductCode = "GUID_NO1"?>
<?define UpgradeCode = "GUID_NO2"?>
<?define ProductVersion = "1.0.0"?>
<Product Id="$(var.ProductCode)"
Name="$(var.ProductName)"
Language="1033"
Version="$(var.ProductVersion)"
Manufacturer="Me"
UpgradeCode="$(var.UpgradeCode)">
<Package Description="My desc"
InstallerVersion="300"
Compressed="yes"
InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version is already installed." />
...
Run Code Online (Sandbox Code Playgroud)
我构建,安装,一切顺利。所以我替换
<?define ProductCode = "GUID_NO3"?>
<?define UpgradeCode = "GUID_NO4"?>
<?define ProductVersion = "1.0.1"?>
Run Code Online (Sandbox Code Playgroud)
我构建、安装并在程序/功能中找到了 2 个 MyApp,一个在 1.0.0 版中,一个在 1.0.1 版中。当然,我需要删除 1.0.0。
为 ProductCode保留相同的 guid将不起作用。
我正在使用 Wix 3.8。
我有一个 WiX 引导程序主题 xml 文件,我想永久禁用一个控件。我试图设置HexStyle为WS_DISABLED(链接)的值。但是,该控件仍处于启用状态。任何人都知道我是否可以使用HexStyle或知道另一种永久禁用控件的方法。我使用WixStandardBootstrapperApplication.RtfLicenseBootstrapperApplication。
什么是托管安装?“msi 正在服务器端运行”是什么意思?“可以将 msi 属性传递给服务器端”是什么意思?
这个问题来自“Property”元素“Secure”属性的wix文档:
Denotes that the Property can be passed to the server side when doing a managed installation with elevated privileges. See the SecureCustomProperties Property for more information.
Run Code Online (Sandbox Code Playgroud) 我的 C#.net 应用程序在 Resources 目录中有一个 .ico 文件(例如 MyProject/Resources/icon.ico),
我使用 WIX 工具集创建了一个安装程序。
当我安装应用程序时,图标显示在窗口的左上角,但不在任务栏上(在应用程序中显示在任务栏中设置为 true),而不是在 .exe 旁边
如何在 wix xml 源代码中引用应用程序图标,使其显示在 Program Files 中的 .exe 文件和开始菜单上?
好吧,我为 excel 编写了一个附加组件,并使用 wix 工具集为它创建了一个 msi 安装程序。问题是我想更改安装程序图标,但从我读到的 msi 安装程序图标无法更改,我想问您是否可以将安装程序从 msi 更改为其他安装程序(例如在 exe 上)和然后更改安装程序图标?
[更新]
我已经使用 wix bootstrap 将 msi 文件更改为 exe,但我仍然不知道如何更改此图标。
感谢所有提示/帮助。
我的问题不是所指出的帖子的重复,因为它是一个 wix 项目,并且给定的解决方案适用于 wpf、winforms 项目。
在我的项目中,没有csproj文件,只有wixproj,它甚至没有<ApplicationIcon>标签。
项目属性也不同,因为构建选项卡中没有上下文。
我们的客户端仅允许在以管理员身份登录时安装应用程序。必须为机器的当前用户安装需要安装的应用程序。该应用程序安装正常,当我需要在用户的 appdata/user 配置文件文件夹中放置一个配置文件时,我的问题就出现了。由于这是他们想要的地方,目前配置正在安装时被删除到管理员配置文件中。我如何解决这个问题,有没有办法让我检查安装是否有其他配置文件并可能写信给他们,但这感觉很脏。
我正在使用此链接中的代码
我的Wix Dialogs看起来像这样
<Control Id="DummyComboBox" Hidden="yes" Type="ComboBox" Sorted="yes" ComboList="yes" Property="DUMMYPROPERTY" X="65" Y="60" Width="150" Height="18">
<ComboBox Property="DUMMYPROPERTY">
<ListItem Text="Dummy" Value="Dummy"/>
</ComboBox>
</Control>
<Control Id="SQLServer" Type="ComboBox" Sorted="yes" ComboList="yes" X="150" Y="100" Width="110" Height="18" Property="DBSERVER"/>
<Control Id="SQLServerLabel" Type="Text" X="25" Y="100" Width="90" Height="18" NoPrefix="yes" Text="!(loc.SQLServerLabel)"/>
<Control Id="SQLDatabaseName" Type="Edit" X="150" Y="120" Width="110" Height="18" Property="SQLDBNAME"/>
<Control Id="SQLDBServerLabel" Type="Text" X="25" Y="120" Width="90" Height="18" NoPrefix="yes" Text="!(loc.SQLDatabaseLabel)"/>
<Control Id="SQLUser" Type="Edit" X="150" Y="140" Width="110" Height="18" Property="SQLUSER"/>
<Control Id="SQLUServerLabel" Type="Text" X="25" Y="140" Width="90" Height="18" NoPrefix="yes" Text="!(loc.SQLUserLabel)"/>
<Control Id="SQLPassword" Type="Edit" X="150" …Run Code Online (Sandbox Code Playgroud) 我是 WIX 的新手,正在尝试创建 MSI 来安装服务。安装项目正在生成 .wixlib 对象而不是 msi。我正在研究这个例子。
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<!-- TODO: Put your code here. -->
<Product Name="Smart Elf Service"
Id="*"
UpgradeCode="927E7BBE-58C0-4832-A821-24A6B19AEE63"
Version="1.0.0.0"
Manufacturer="Me!"
Language="1033">
<Package
Manufacturer="Me!"
InstallerVersion="100"
Languages="1033" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="Program Files(x86)">
<Directory Id="CorporationFolder" Name="Corporation">
<Directory Id="SmartElfFolder" Name="SmartElf Service">
<Component Id="SmartElfService">
<File Id="SmartElfServiceBinary" Name="ElfVerificationService.exe" Source ="..\ElfVerificationService\bin\debug\ElfVerificationService.exe" KeyPath="yes" Vital="yes"/>
<ServiceInstall
Id="SI_SmartElfService"
Vital="yes"
Name="sesvc"
DisplayName="SmartElf Service"
Start="auto"
ErrorControl="normal"
Type="ownProcess"
/>
<ServiceControl
Id="SC_SmartElfService"
Name="sesvc"
Start="install"
Stop="both"
Remove="uninstall"
Wait="yes"
/>
</Component>
</Directory>
</Directory> …Run Code Online (Sandbox Code Playgroud) 我可以在wix的setup项目中编写一个注册表项和值,代码如下:
<RegistryKey Id="WinApp" Root="HKLM" Key="Software\App\[ProductName]" Action="createAndRemoveOnUninstall" >
<RegistryValue Type="string" Name="InstallName" Value="[ProductName]" Action="write" KeyPath="yes"></RegistryValue>
</RegistryKey>
Run Code Online (Sandbox Code Playgroud)
我怎么能在bootstrapper项目中做?
wix ×11
c# ×3
bootstrapper ×2
.net ×1
directory ×1
installation ×1
jenkins ×1
msbuild ×1
profiles ×1
registry ×1
server-side ×1
versioning ×1
windows ×1
wix3.5 ×1
wix3.8 ×1