小编Nic*_*eri的帖子

在wix uninstall上,IIS网站物理路径变为空白

背景:我有一个Wix安装程序,在现有的IIS网站中创建虚拟目录.创建虚拟目录(在安装之前它不存在)但是应该已经创建了IIS网站(用户只需选择要安装到ListBox中的网站).

问题:在卸载时,安装到的IIS网站的物理路径变为空白,该属性没有值.下面是我的主要wix文件的简化版本.我不确定为什么卸载会影响IIS网站,但任何想法都表示赞赏.

注意:我在Wix 3.5和Windows Server 2008 R2,IIS 7上.

<Product>

    <Property Id='WEBSITE_DESCRIPTION'>
      <RegistrySearch Id='RememberPropertyWEBSITE_DESCRIPTION' Root='HKCU'
        Key='SOFTWARE\Company\Product' Name='InstalledWebsiteDescription'
        Type='raw' />
    </Property>

    <Property Id='WEBSITE_PORT'>
      <RegistrySearch Id='RememberPropertyWEBSITE_PORT' Root='HKCU'
        Key='SOFTWARE\Company\Product' Name='InstalledWebsitePort'
        Type='raw' />
    </Property>


    <Component Id='PropertiesToSave' Directory='ApplicationFolder'>
      <RegistryValue Root='HKCU' Key='SOFTWARE\Company\Product'
        Name='InstalledWebsiteDescription' Value='[WEBSITE_DESCRIPTION]'
        Type='string' />
      <RegistryValue Root='HKCU' Key='SOFTWARE\Company\Product'
        Name='InstalledWebsitePort' Value='[WEBSITE_PORT]'
        Type='string' />

      <RemoveFolder Id='CleanupApplicationFolder' On='uninstall' />
    </Component>


    <Directory Id='TARGETDIR' Name='SourceDir'>
      <Component Id='TestWebVirtualDirComponent' Guid='12345678-6304-410E-A808-E3585379EADB'>
        <CreateFolder />
        <iis:WebVirtualDir Id='TestWebVirtualDir' Alias='[WEBSITE_VIRTUALDIR]' Directory='TARGETDIR' WebSite='MyWebsite'>
          <iis:WebApplication Id='TestWebApplication' Name='Test' />
        </iis:WebVirtualDir>
      </Component>
    </Directory>

    <iis:WebSite Id="MyWebsite" Description="[WEBSITE_DESCRIPTION]" SiteId="*">
      <iis:WebAddress Id="AllUnassigned" Port="[WEBSITE_PORT]" />
    </iis:WebSite> …
Run Code Online (Sandbox Code Playgroud)

iis iis-7 wix wix3.5

8
推荐指数
1
解决办法
1880
查看次数

相对于光标,自定义映射滚动Vim

所以我已阅读:help scroll-cursor并非常喜欢zz,它将光标所在的行放在窗口中间.

我正在寻找帮助来制作一个类似的映射,zz但是将光标放在窗口高度的20%处(或25%,30%等).


编辑:

感谢ZyX和Drasill,我能够修改他的功能以获得所需的功能:

function ScrollToPercent(percent)
    let movelines=winheight(0)*a:percent/100

    if has("float") && type(movelines)==type(0.0)
        let movelines=float2nr(movelines)
    endif

    let oldso=&so
    execute ":set so=" . movelines
    execute "normal! zt"
    execute ":set so=" . oldso
endfunction
Run Code Online (Sandbox Code Playgroud)

vim

6
推荐指数
2
解决办法
2695
查看次数

在添加节点时,让Nokogiri不添加"默认"命名空间

背景:

我想从一个文件中获取一些xml,将其放在模板文件中,然后将修改后的模板保存为新文件.它可以正常工作,但是当我保存文件时,我添加的所有节点都有一个预先定义的默认命名空间,即

        <default:ComponentRef Id="C__AD1817F9C64A42F0A14DDDDC82DFC8D9"/>
        <default:ComponentRef Id="C__157DD41D70854617A3D6D1E4A39B589F"/>
        <default:ComponentRef Id="C__2E6D8662F38FE62CAFA9F8842A28F510"/>
        <default:ComponentRef Id="C__54E5E2181323D4A5F37293DAA87B4230"/>
Run Code Online (Sandbox Code Playgroud)

我想要的只是:

        <ComponentRef Id="C__AD1817F9C64A42F0A14DDDDC82DFC8D9"/>
        <ComponentRef Id="C__157DD41D70854617A3D6D1E4A39B589F"/>
        <ComponentRef Id="C__2E6D8662F38FE62CAFA9F8842A28F510"/>
        <ComponentRef Id="C__54E5E2181323D4A5F37293DAA87B4230"/>
Run Code Online (Sandbox Code Playgroud)

以下是我的ruby代码:

file = "wixmain/generated/DarkOutput.wxs"
template = "wixmain/generated/MsiComponentTemplate.wxs"
output = "wixmain/generated/MSIComponents.wxs"

dark_output = Nokogiri::XML(File.open(file))
template_file = Nokogiri::XML(File.open(template))

#get stuff from dark output
components = dark_output.at_css("Directory[Id='TARGETDIR']")
component_ref = dark_output.at_css("Feature[Id='DefaultFeature']")

#where to insert in template doc
template_component_insert_point = template_file.at_css("DirectoryRef[Id='InstallDir']")
template_ref_insert_point = template_file.at_css("ComponentGroup[Id='MSIComponentGroup']")

template_component_insert_point.children= components.children()
template_ref_insert_point.children= component_ref.children()

#write out filled template to output file
File.open(output, 'w') { |f| template_file.write_xml_to f }
Run Code Online (Sandbox Code Playgroud)

更新

我的模板文件示例:

<?xml version="1.0" …
Run Code Online (Sandbox Code Playgroud)

ruby xml nokogiri

1
推荐指数
1
解决办法
1135
查看次数

标签 统计

iis ×1

iis-7 ×1

nokogiri ×1

ruby ×1

vim ×1

wix ×1

wix3.5 ×1

xml ×1