Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
配置编辑的wix自定义对话框_Wix_Dialog_Config - Fatal编程技术网

配置编辑的wix自定义对话框

配置编辑的wix自定义对话框,wix,dialog,config,Wix,Dialog,Config,嗨,我正在尝试使用wix v3为我的应用程序设置msi 我对这项任务有疑问; 我需要一个将存储在应用程序配置文件中的用户输入 (例如,我需要一个sql连接字符串对话框,用户输入将写入应用程序配置文件。) 我试着用谷歌搜索,但什么也没用 非常感谢您的帮助。您需要做三件事: 创建自定义属性: <Wix> <Product ...> <Property Id="SQLSERVER" /> ... </Product> </Wix>

嗨,我正在尝试使用wix v3为我的应用程序设置msi 我对这项任务有疑问; 我需要一个将存储在应用程序配置文件中的用户输入 (例如,我需要一个sql连接字符串对话框,用户输入将写入应用程序配置文件。)

我试着用谷歌搜索,但什么也没用


非常感谢您的帮助。

您需要做三件事:

  • 创建自定义属性:

    <Wix>
     <Product ...>
       <Property Id="SQLSERVER" /> ... 
     </Product>
    </Wix>
    
     <util:XmlFile Id="UpdateConnectionStringInConfigSection" File="[ROOT_DRIVE]inetpub/wwwroot/$(var.ProductName)/web.config" Action="setValue" ElementPath="/configuration/connectionStrings/add[\[]@name=&quot;ConnectionString&quot;[\]]/@connectionString" Value="[SQLSERVER]" Permanent="yes" />
    
    
    ... 
    
  • 向Wix UI添加自定义对话框以捕获用户输入并将其存储到属性。这应该对你有所帮助

  • 在安装web.config文件的组件中,使用XmlFile元素使用属性值更新web.config:

    <Wix>
     <Product ...>
       <Property Id="SQLSERVER" /> ... 
     </Product>
    </Wix>
    
     <util:XmlFile Id="UpdateConnectionStringInConfigSection" File="[ROOT_DRIVE]inetpub/wwwroot/$(var.ProductName)/web.config" Action="setValue" ElementPath="/configuration/connectionStrings/add[\[]@name=&quot;ConnectionString&quot;[\]]/@connectionString" Value="[SQLSERVER]" Permanent="yes" />
    
    
    

  • 你从哪里来?它不显示在我的VS2010智能感知中。明白了。添加对WixUtilExtension DLL的引用,并在XML中包含名称空间(如果它有助于其他人的话),要扩展上面Andez的评论,我必须使用以下行定义名称空间(添加http://并删除分号):