Wix note (3)

1) Register Search
<Property Id="INSTALLDIR">
  <RegistrySearch Id='AcmeFoobarRegistry' Type='raw'
    Root='HKLM' Key='Software\Acme\Foobar 1.0' Name='InstallDir' />
</Property>
2) ini file Search
<Property Id="INSTALLDIR">
  <IniFileSearch Id='AcmeFoobarIniFile' Type='directory'
    Name='SampleRegistry.ini' Section='Sample' Key='InstallDir' />
</Property>
3) Directory Search
<Property Id="FILEEXISTS">
  <DirectorySearch Id="CheckFileDir" Path="[INSTALLDIR]" Depth="0">
    <FileSearch Id="CheckFile" Name="Lookfor.txt" />
  </DirectorySearch>
</Property>

4) Conditional Installation
<Feature Id='Documentation' Level='1'>
  <ComponentRef Id='Manual' />
  <Condition Level="1">FILEEXISTS</Condition>
</Feature>
5) Add Registry Key

To create a registry keys, include them inside a RegistryKey in the component

<RegistryKey Id='FoobarRegInstallDir' Root='HKLM' Key='Software\Acme\Foobar 1.0' Action='createAndRemoveOnUninstall'>
  <RegistryValue Type='multiString' Name='InstallDir' Value='[TARGETDIR]'/>
  <RegistryValue Type='multiString' Name='InstallDir' Value='[INSTALLDIR]' Action='append'/>
  <RegistryValue Type='multiString' Name='InstallDir' Value='[ProgramFilesFolder] Action='append'/>
</RegistryKey>

Action:create , createAndRemoveOnUninstall

Type: can be string, integer, binary, expandable andmultistring.

6) Register  our own file data type.

Put a ProgId inside your component. FileId should refer to theId attribute of theFile element describing the file meant to handle the files of this extension.

<ProgId Id='AcmeFoobar.xyzfile' Description='Acme Foobar data file'>
  <Extension Id='xyz' ContentType='application/xyz'>
    <Verb Id='open' Command='Open' TargetFile='FileId' Argument='"%1"' />
  </Extension>
</ProgId>


To assign an icon to this file type, you have to specify where the icon should come from:

<ProgId Id='AcmeFoobar.xyzfile' Description='Acme Foobar data file' Icon='Foobar.ico'>

or, if the icon comes from an executable or resource file containing several icons, you can specify which one:

<ProgId Id='AcmeFoobar.xyzfile' Description='Acme Foobar data file' Icon='Foobar.exe' IconIndex='1'>
7) Write an .ini file
<IniFile Id="WriteIntoIniFile" Action="addLine" Key="InstallDir" Name="Foobar.ini"
  Section="Paths" Value="[INSTALLDIR]" />
8) Remove file/folder created during functioning
<DirectoryRef Id="SDKDir">
	<Directory Id='ConfigDir' Name='Config'>
		<Component
		Id='RemoveConfigFolderComponent'
		Guid='BCF6AECA-16BA-4994-9722-7E2A910462A1'
		Win64='yes'>
			<!--Remove our cache files ect.-->
			<RemoveFile Id='ConfigFiles' Name='*.*' On='uninstall'/>
			<RemoveFolder Id='ConfigDir'  On='uninstall'/>
		</Component>
	</Directory>
	<Component
		Id='RemoveFolderComponent'
		Guid='76422AD9-71FD-49ed-BEB3-2624F84E0A77'
		Win64='yes'>
		<RemoveFolder Id='SDKDir' On='uninstall'/>
	</Component>
</DirectoryRef>

On: install, uninstall and both.

The Name can contain wildcard characters, too. The file or files should be located in the same folder as the component itself

9) Add icon that will be displayed in Program and Feature to our application. 
<Icon Id='ProductIcon' SourceFile='Resource\ico.ico'/>
<Property Id="ARPPRODUCTICON" Value="ProductIcon" />
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值