配置 – 从WIX设置更新app.config?
发布时间:2020-12-13 20:30:33 所属栏目:Windows 来源:网络整理
导读:我正在尝试Wix 3.6,这就是它现在的样子: ?xml version="1.0" encoding="UTF-8"? Directory Id="TARGETDIR" Name="SourceDir" Directory Id="myappINSTALLDIR" Name="myapp5Service" Component Id="SampleServiceComponent" DiskId="1" Guid="6f51c0f3-776c-
我正在尝试Wix 3.6,这就是它现在的样子:
<?xml version="1.0" encoding="UTF-8"?> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="myappINSTALLDIR" Name="myapp5Service"> <Component Id="SampleServiceComponent" DiskId="1" Guid="6f51c0f3-776c-4aec-a200-1f199352c6c3" Win64="yes"> <File Id="myapp5.WindowsService.exe" Name="myapp5.WindowsService.exe" Source="$(var.myapp.WindowsService.TargetDir)myapp5.WindowsService.exe" KeyPath='yes'/> ... <ServiceInstall Id="InstallmyappService" DisplayName="myappService" Name="myapp5.WindowsService.exe" Description="myapp 5 Service - F?r effektivare och enklare operationsplanering" Account="LocalSystem" ErrorControl="normal" Start="auto" Type="ownProcess" Vital="yes" /> <ServiceControl Id="ControlmyappService" Name="myapp5.WindowsService.exe" Start="install" Stop="both" Remove="uninstall" Wait="yes" /> </Component> </Directory> </Directory> <WixVariable Id="WixUIBannerBmp" Value="$(var.ProjectDir)ImagemyappTopBanner.bmp" /> <WixVariable Id="WixUIDialogBmp" Value="$(var.ProjectDir)ImagemyappDialogBackground.bmp" /> <Property Id="WIXUI_INSTALLDIR" Value="myappINSTALLDIR" /> <UIRef Id="WixUI_InstallDir" /> <Feature Id="ProductFeature" Title="Wix_myapp.WindowsService" Level="1"> <ComponentRef Id="SampleServiceComponent" /> </Feature> <Media Id="1" Cabinet="SampleServiceComponent.cab" EmbedCab="yes" /> </Product> 现在我需要在Wix设置中添加一个对话框,其中一个appSetting和一个baseadress(WCF)设置为app.config.这大部分都是在安装之前完成的,因为它将决定Wix安装的Windows服务的名称. 而exampel会很棒! 编辑1: <WixVariable Id="WixUIBannerBmp" Value="$(var.ProjectDir)ImagemyappTopBanner.bmp" /> <WixVariable Id="WixUIDialogBmp" Value="$(var.ProjectDir)ImagemyappDialogBackground.bmp" /> <Property Id="SERVICEADDRESS" Value="http://serviceaddress"/> <Property Id="WIXUI_INSTALLDIR" Value="myappINSTALLDIR" /> <UIRef Id="WixUI_InstallDir" /> <util:XmlFile Id="UpdateBaseAddress" Action="setValue" File="$(var.myapp.WindowsService.TargetDir)myapp5.WindowsService.exe.config" SelectionLanguage="XPath" Permanent="yes" ElementPath="/configuration/applicationSettings/ServiceName" Name="baseAddress" Value="[SERVICEADDRESS]" /> <Feature Id="ProductFeature" Title="Wix_myapp.WindowsService" Level="1"> <ComponentRef Id="SampleServiceComponent" /> </Feature> <Media Id="1" Cabinet="SampleServiceComponent.cab" EmbedCab="yes" /> </Product>
您可以将WixUtilExtension.dll的引用添加到安装程序项目,然后使用XmlFile更新app.config,如:
<Property Id="SERVICEADDRESS" Value="http://serviceaddress"/> <util:XmlFile Id="UpdateBaseAddress" Action="setValue" File="[DirApplication]$(var.app.config)" SelectionLanguage="XPath" Permanent="yes" ElementPath="/configuration/applicationSettings/...." Name="baseAddress" Value="[SERVICEADDRESS]" /> 请注意,您需要设置目录和.config文件的名称(您可以使用$(var.ProjectName.TargetFileName).config,它应该自动为您完成 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Spyder接口图标非常小在Windows 10的高分辨率屏幕上
- 错误无法在本地Windows 7 Ruby on Rails上加载’pg’gem
- Windows Server 2012忽略静态路由
- windows – 从WMI ExecQuery获取第一条记录
- Monodevelop无法构建,找不到Microsoft.DiaSymReader.Native
- 如何在Windows上修补?
- windows-server-2008-r2 – 从Windows Server 2008 R2升级到
- windows – 如何退出桌面版GitHub?
- windows-service – 无法使用sc命令删除现有服务:指定的服
- win10安装ubuntu16.04及后续配置
推荐文章
站长推荐
- Windows下PHP开发环境搭建教程(Apache+PHP+MySQL
- Windows Phone 8的C#游戏开发?
- windows-server-2008-r2 – 使用WMIC停止计划任务
- windows-phone-8 – 获取Windows Phone 8资源密集
- windows-8 – 如何在Windows 8 Store HTML / JS应
- windows – 需要运行.exe,然后在~10秒后终止它并
- windows-server-2008 – IIS中止状态为995的请求
- windows – 从DLL导出所有内容会影响性能
- IP端口监控工具使用
- windows环境:idea或者eclipse指定用户名操作had
热点阅读