Following content is directly reprinted from From MSI to WiX, Part 19 - The Art of Custom Action, Part 1

Author:Alex Shevchuk

Introduction

Today we will start exploring custom actions, how to write them, what makes custom action good custom action and everything else related to custom actions.

Let's start with very simple sample.  We have an application which creates a new file during run-time and this file is not part of originally installed files.  On uninstall we need to delete this file as well.  The name of the file is well known.

Here is the source for our test console application:

using System;
using System.Collections.Generic;
using System.Text;
using System.IO; namespace Test
{
class Program
{
static void Main(string[] args)
{
using (StreamWriter fs = File.CreateText("Test.txt"))
{
fs.Write("Hello");
} Console.WriteLine("Bye");
}
}
}

During run time our program creates Test.txt file which we want to remove on our test application uninstall.  Because new file name is well known, all we need to do is to add RemoveFile element:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">
<Product Id="{2F59639E-4626-44f8-AAF0-EE375B766221}"
Name="Test Application"
Language="1033"
Version="0.0.0.0"
Manufacturer="Your Company">
<Package Id="????????-????-????-????-????????????"
Description="Shows how to delete run-time file with known file name."
Comments="This will appear in the file summary stream."
InstallerVersion="200"
Compressed="yes" /> <Media Id="1" Cabinet="Product.cab" EmbedCab="yes" /> <Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="Test1" LongName="Test for removal of run time file"> <Component Id="ProductComponent"
Guid="{8F4CC43A-9290-4c93-9B97-B9FC1C3579CC}">
<File Id="Test.exe" DiskId="1" Name="Test.exe"
Source="..\Test\bin\Debug\Test.exe" KeyPath="yes" /> <RemoveFile Id="Test.txt" On="uninstall" Name="Test.txt" />
</Component> </Directory>
</Directory>
</Directory> <Feature Id="ProductFeature" Title="Feature Title" Level="1">
<ComponentRef Id="ProductComponent" />
</Feature>
</Product>
</Wix>

To test our install, install application, go to installation folder and run Test.exe.  Application will create Test.txt file.  Uninstall application and make sure that installation folder is gone.

There is no need for custom action in here.  Things are more complicated if our program creates file or files with unknown at installation creation package time.

Here is an updated version of Test application.  It creates a file with arbitrary name:

using System;
using System.Collections.Generic;
using System.Text;
using System.IO; namespace Test
{
class Program
{
static void Main(string[] args)
{
using (StreamWriter fs = File.CreateText(DateTime.Now.Ticks.ToString()+ ".log"))
{
fs.Write("Hello");
} Console.WriteLine("Bye");
}
}
}

Because we don't know the name of the new file we need custom action which will find this new file and delete it.  This custom action must be deferred and, for simplicity sake, we will be using VBScript custom action type 38 (seeintroduction to custom actions for more details).  Because our custom action is deferred, we will pass all required parameters through CustomActionData property (see here for details).

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">
<Product Id="{2F59639E-4626-44f8-AAF0-EE375B766221}"
Name="Test Application"
Language="1033"
Version="0.0.0.0"
Manufacturer="Your Company">
<Package Id="{58BCF2DD-16A0-4654-B289-F13AADA240CD}"
Description="Shows how to delete run-time file with known file name."
Comments="This will appear in the file summary stream."
InstallerVersion="200"
Compressed="yes" /> <Media Id="1" Cabinet="Product.cab" EmbedCab="yes" /> <Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="Test1" LongName="Test for removal of run time file"> <Component Id="ProductComponent"
Guid="{8F4CC43A-9290-4c93-9B97-B9FC1C3579CC}">
<File Id="Test.exe" DiskId="1" Name="Test.exe"
Source="..\Test\bin\Debug\Test.exe" KeyPath="yes" />
</Component> </Directory>
</Directory>
</Directory> <CustomAction Id="RemoveTempFile" Script="vbscript" Execute="deferred">
<![CDATA[
On error resume next
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile(Session.Property("CustomActionData") + "*.log")
Set fso = Nothing
]]>
</CustomAction> <CustomAction Id="SetCustomActionData"
Property="RemoveTempFile" Value="[INSTALLLOCATION]" /> <InstallExecuteSequence>
<Custom Action="SetCustomActionData" Before="RemoveTempFile">REMOVE="ALL"</Custom>
<Custom Action="RemoveTempFile" Before="RemoveFiles">REMOVE="ALL"</Custom>
</InstallExecuteSequence> <Feature Id="ProductFeature" Title="Feature Title" Level="1">
<ComponentRef Id="ProductComponent" />
</Feature>
</Product>
</Wix>

Few things to notice in here.  First of all, we need to set CustomActionData property before our RemoveTempFile custom action.  RemoveTempFile custom action must be scheduled before RemoveFiles standard action because this standard action decides on whether installation folder will be removed or not.  If at the end of RemoveFiles standard action folder is not empty, folder won't be deleted. That's why we want to delete extra files before RemoveFiles standard action.  Also, both custom actions are conditioned to run on complete uninstall only.

Let's test our installer.  Install application and run Test.exe a few times.  After every run you will see a new file being created.  Now uninstall the application.  Installation folder should disappear.

So, are we successfully solved the problem?  Let's create an uninstall failure condition.  In all good installation packages all changes made during uninstall should be rolled back in case of uninstall failure.  Let's see how we are doing.  The easiest way to create an uninstall failure is to schedule deferredcustom action type 54 right before InstallFinalize standard action.  We can't use custom action type 19 because this custom action does not allow setting execution option (in other words, it is always immediate custom action) and we want to fail an installation after we ran our RemoveTempFile custom action.

Here is our updated WiX source file:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">
<Product Id="{2F59639E-4626-44f8-AAF0-EE375B766221}"
Name="Test Application"
Language="1033"
Version="0.0.0.0"
Manufacturer="Your Company">
<Package Id="{58BCF2DD-16A0-4654-B289-F13AADA240CD}"
Description="Shows how to delete run-time file with known file name."
Comments="This will appear in the file summary stream."
InstallerVersion="200"
Compressed="yes" /> <Media Id="1" Cabinet="Product.cab" EmbedCab="yes" /> <Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="Test1" LongName="Test for removal of run time file"> <Component Id="ProductComponent"
Guid="{8F4CC43A-9290-4c93-9B97-B9FC1C3579CC}">
<File Id="Test.exe" DiskId="1" Name="Test.exe"
Source="..\Test\bin\Debug\Test.exe" KeyPath="yes" />
</Component> </Directory>
</Directory>
</Directory> <CustomAction Id="RemoveTempFile" Script="vbscript" Execute="deferred">
<![CDATA[
On error resume next
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile(Session.Property("CustomActionData") + "*.log")
Set fso = Nothing
]]>
</CustomAction> <CustomAction Id="SetCustomActionData"
Property="RemoveTempFile" Value="[INSTALLLOCATION]" /> <Property Id="FailureProgram">
<![CDATA[
Function Main()
Main = 3
End Function
]]>
</Property> <CustomAction Id="FakeFailure"
VBScriptCall="Main"
Property="FailureProgram"
Execute="deferred" /> <InstallExecuteSequence>
<Custom Action="SetCustomActionData" Before="RemoveTempFile">REMOVE="ALL"</Custom>
<Custom Action="RemoveTempFile" Before="RemoveFiles">REMOVE="ALL"</Custom> <Custom Action='FakeFailure' Before='InstallFinalize'>REMOVE="ALL" AND TESTFAIL</Custom>
</InstallExecuteSequence> <Feature Id="ProductFeature" Title="Feature Title" Level="1">
<ComponentRef Id="ProductComponent" />
</Feature>
</Product>
</Wix>

FakeFailure custom action is running VBScript stored in the FailureProgram property.  This script just returns the value 3 which means that script has failed.  This return code will force Windows Installer engine to fail an uninstall and roll back all changes made up to this point.  We also put a condition on FakeFailure custom action to run on uninstall and only if TESTFAIL property is defined.  The reason for this is that we don't want our installation package to be stuck in uninstall failure.  Doing that will require use of MsiZap tool to remove our installation from the system.  Instead, we allow uninstall to succeed normally, but if we want to fail an installation we must use command line to do that:

msiexec /uninstall Project.msi TESTFAIL=YES

Let's install our test application, run Test.exe few times.  Make sure that we have few files created in the same folder where Test.exe is located.  Now try to uninstall program by running above mentioned command in the command window.  Installation will fail.  Go back to installation folder where Test.exe file is located and observe that all files created by Test.exe are gone.

Depending on what those files are that may be OK, but that could be a big problem.  Imagine, that our Test.exe is a personal finance management software (something like Microsoft Money) and it stores last synchronization  with bank's server data.  By removing those extra files we are forcing our software to resynch the whole transaction history on the next run.  That's bad.

So, how we can fix the problem.  Remember, that in addition to immediate and deferred custom actions we have also rollback (runs during rollback installation phase) and commit (runs at the end of successful transaction) custom actions.  Changes that we are going to make are:

  • Deferred custom action will move files to be deleted into temporary folder
  • Commit custom action will delete files from the temporary folder
  • Rollback custom action will move files back from temporary folder to installation folder

Because scripts will be larger than custom action type 38 can store we will be using custom action type 6 instead (again, see introduction to custom actionsfor more details).

Here is the deferred custom action (MoveTempFile.vbs):

Function Main()

    On Error Resume Next

    Dim properties, tempFile, fso, folder

    Const msiDoActionStatusSuccess = 

    properties = Split(Session.Property("CustomActionData"), ";", -, )
tempFile = properties() & "{42A7DCCB-868B-4D11-BBBE-5A32B8DF5CC9}\" Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.CreateFolder(tempFile)
fso.DeleteFile tempFile & "*.log", true
fso.MoveFile properties() & "*.log", tempFile
Set folder = Nothing
Set fso = Nothing Main = msiDoActionStatusSuccess End Function

In CustomActionData we will pass both INSTALLLOCATION and TempFolderproperties.  This script will create subfolder in the TempFolder.  Subfolder's name is the UpgradeCode Guid.  It will move log files from installation folder to temporary folder.

Commit script (CommitTempFile.vbs) will delete log files from temporary folder:

Function Main()

    On Error Resume Next

    Dim properties, tempFile, fso, folder

    Const msiDoActionStatusSuccess = 

    properties = Split(Session.Property("CustomActionData"), ";", -, )
tempFile = properties() & "{42A7DCCB-868B-4D11-BBBE-5A32B8DF5CC9}\" Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile tempFile & "*.log", true
Set fso = Nothing Main = msiDoActionStatusSuccess End Function

And Rollback script will move files back from temporary folder to installation folder:

Function Main()

    On Error Resume Next

    Dim properties, tempFile, fso

    Const msiDoActionStatusSuccess = 

    properties = Split(Session.Property("CustomActionData"), ";", -, )
tempFile = properties() & "{42A7DCCB-868B-4D11-BBBE-5A32B8DF5CC9}\" Set fso = CreateObject("Scripting.FileSystemObject")
fso.MoveFile tempFile & "*.log", properties()
Set fso = Nothing Main = msiDoActionStatusSuccess End Function

Here is the updated WiX source code:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">
<Product Id="{2F59639E-4626-44f8-AAF0-EE375B766221}"
Name="Test Application"
Language="1033"
Version="0.0.0.0"
Manufacturer="Your Company"
UpgradeCode="{42A7DCCB-868B-4D11-BBBE-5A32B8DF5CC9}">
<Package Id="{58BCF2DD-16A0-4654-B289-F13AADA240CD}"
Description="Shows how to delete run-time file with known file name."
Comments="This will appear in the file summary stream."
InstallerVersion="200"
Compressed="yes" /> <Media Id="1" Cabinet="Product.cab" EmbedCab="yes" /> <Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="Test1" LongName="Test for removal of run time file"> <Component Id="ProductComponent"
Guid="{8F4CC43A-9290-4c93-9B97-B9FC1C3579CC}">
<File Id="Test.exe" DiskId="1" Name="Test.exe"
Source="..\Test\bin\Debug\Test.exe" KeyPath="yes" />
</Component> </Directory>
</Directory>
</Directory> <Binary Id="MoveTempFileScript" SourceFile="MoveTempFile.vbs" />
<Binary Id="CommitTempFileScript" SourceFile="CommitTempFile.vbs" />
<Binary Id="RollbackTempFileScript" SourceFile="RollbackTempFile.vbs" /> <CustomAction Id="MoveTempFile"
BinaryKey="MoveTempFileScript"
VBScriptCall="Main"
Execute="deferred"
Return="check" /> <CustomAction Id="CommitTempFile"
BinaryKey="CommitTempFileScript"
VBScriptCall="Main"
Execute="commit"
Return="check" /> <CustomAction Id="RollbackTempFile"
BinaryKey="RollbackTempFileScript"
VBScriptCall="Main"
Execute="rollback"
Return="check" /> <CustomAction Id="SetMoveData"
Property="MoveTempFile" Value="[INSTALLLOCATION];[TempFolder]" /> <CustomAction Id="SetCommitData"
Property="CommitTempFile" Value="[INSTALLLOCATION];[TempFolder]" /> <CustomAction Id="SetRollbackData"
Property="RollbackTempFile" Value="[INSTALLLOCATION];[TempFolder]" /> <Property Id="FailureProgram">
<![CDATA[
Function Main()
Main = 3
End Function
]]>
</Property> <CustomAction Id="FakeFailure"
VBScriptCall="Main"
Property="FailureProgram"
Execute="deferred" /> <InstallExecuteSequence>
<Custom Action="SetMoveData" Before="MoveTempFile">REMOVE="ALL"</Custom>
<Custom Action="MoveTempFile" Before="RemoveFiles">REMOVE="ALL"</Custom> <Custom Action="SetCommitData" Before="CommitTempFile">REMOVE="ALL"</Custom>
<Custom Action="CommitTempFile" After="MoveTempFile">REMOVE="ALL"</Custom> <Custom Action="SetRollbackData" Before="RollbackTempFile">REMOVE="ALL"</Custom>
<Custom Action="RollbackTempFile" After="MoveTempFile">REMOVE="ALL"</Custom> <Custom Action='FakeFailure' Before='InstallFinalize'>REMOVE="ALL" AND TESTFAIL</Custom>
</InstallExecuteSequence> <Feature Id="ProductFeature" Title="Feature Title" Level="1">
<ComponentRef Id="ProductComponent" />
</Feature>
</Product>
</Wix>

You can test it now to make sure that on uninstall failure all files get restored.

So, are we done yet?  Not quite.  Why?  Because there is much better alternativefor this type of tasks.  What we can do is populate RemoveFile table, just like WiX did for us in our first sample when we wanted to remove file with well-known name.  Just open msi file from Step 1 using Orca tool.  You will see RemoveFiletable on the left:

FileKey Component_ FileName DirProperty InstallMode
Test.txt ProductComponent Test.txt INSTALLLOCATION 2

Time to make an excuse:  Those who pay attention to what they read have alredy noticed that FileName column of RemoveFile table has WildCardFilename type and therefore allows using wildcards.  So, why I did not make my component something like this and called it done:

<Component Id="ProductComponent" Guid="{8F4CC43A-9290-4c93-9B97-B9FC1C3579CC}">
<File Id="Test.exe" DiskId="1" Name="Test.exe" Source="..\Test\bin\Debug\Test.exe" KeyPath="yes" />
<RemoveFile Id="RemoveTempFiles" On="uninstall" Name="*.log" />
</Component>

Well, my goal was to show why do we need rollback and commit custom actions.  Let's imagine for a moment that we are dealing with unknown at compile time set of file extensions and continue with our discussion.

So, what we are going to do with our immediate custom action is populate this table with the names of the files created by our application during run-time.  After that, Windows Installer will take care of Commit and Rollback actions, so we won't need these custom actions anymore.  Custom action must be an immediate custom action because during deferred phase session and database handle are no longer accessible.

Here is the source of the custom action:

Function Main()

    On Error Resume Next

    Dim fso, folder, files
Dim DirProperty, ComponentId, InstallFolder
Dim database, view, record Const msiDoActionStatusSuccess =
Const msiViewModifyInsertTemporary = InstallFolder = Session.Property("INSTALLLOCATION")
ComponentId = "ProductComponent"
DirProperty = "INSTALLLOCATION" Set database = Session.Database
Set view = database.OpenView("SELECT `FileKey`, `Component_`, `FileName`, `DirProperty`, `InstallMode` FROM `RemoveFile`")
view.Execute Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder(InstallFolder)
Set files = folder.Files
For Each file in files
If fso.GetExtensionName(file.name) = "log" Then
Set record = installer.CreateRecord()
record.StringData() = file.name
record.StringData() = ComponentId
record.StringData() = file.name
record.StringData() = DirProperty
record.IntegerData() = view.Modify msiViewModifyInsertTemporary, record
End If
Next view.Close
Set view = Nothing
database.Commit
Set database = Nothing Set files = Nothing
Set folder = Nothing
Set fso = Nothing Main = msiDoActionStatusSuccess End Function

It opens installer's database and inserts temporary records into RemoveFiletable.

Here is updated WiX source code:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">
<Product Id="{2F59639E-4626-44f8-AAF0-EE375B766221}"
Name="Test Application"
Language="1033"
Version="0.0.0.0"
Manufacturer="Your Company"
UpgradeCode="{42A7DCCB-868B-4D11-BBBE-5A32B8DF5CC9}">
<Package Id="{58BCF2DD-16A0-4654-B289-F13AADA240CD}"
Description="Shows how to delete run-time file with known file name."
Comments="This will appear in the file summary stream."
InstallerVersion="200"
Compressed="yes" /> <Media Id="1" Cabinet="Product.cab" EmbedCab="yes" /> <Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="Test1" LongName="Test for removal of run time file"> <Component Id="ProductComponent"
Guid="{8F4CC43A-9290-4c93-9B97-B9FC1C3579CC}">
<File Id="Test.exe" DiskId="1" Name="Test.exe"
Source="..\Test\bin\Debug\Test.exe" KeyPath="yes" /> <!--
Uncomment next line and comment out MoveTempFile custom action
to test wildcard file removal option
<RemoveFile Id="RemoveTempFiles" On="uninstall" Name="*.log" />
-->
</Component> </Directory>
</Directory>
</Directory> <EnsureTable Id="RemoveFile" /> <Binary Id="MoveTempFileScript" SourceFile="MoveTempFile.vbs" /> <CustomAction Id="MoveTempFile"
BinaryKey="MoveTempFileScript"
VBScriptCall="Main"
Execute="immediate"
Return="check" /> <Property Id="FailureProgram">
<![CDATA[
Function Main()
Main = 3
End Function
]]>
</Property> <CustomAction Id="FakeFailure"
VBScriptCall="Main"
Property="FailureProgram"
Execute="deferred" /> <InstallExecuteSequence>
<Custom Action="MoveTempFile" Before="RemoveFiles">REMOVE="ALL"</Custom> <Custom Action='FakeFailure' Before='InstallFinalize'>REMOVE="ALL" AND TESTFAIL</Custom>
</InstallExecuteSequence> <Feature Id="ProductFeature" Title="Feature Title" Level="1">
<ComponentRef Id="ProductComponent" />
</Feature>
</Product>
</Wix>

One thing to notice here is that I am using new EnsureTable element.  WiX does not create standard tables if they are empty.  Because we don't have anywhere in our WiX code RemoveFile elements WiX will not create RemoveFile table.  HavingEnsureTable element tells to WiX compiler that RemoveFile table must be created even though it is empty.

In Part 2 we will try to make this custom action reusable.

Code is attached.

The Art of Custom Actions1.zip

WIX Custom Action (immediate, deffered, rollback)的更多相关文章

  1. Wix打包系列(三)自定义Action(Custom Action)

    原文:Wix打包系列(三)自定义Action(Custom Action) 3.1 关于Action 我们已经知道如何生成具有标准安装界面的安装程序了,Windows Installer按照我们的界面 ...

  2. SharePoint 2010/SharePoint 2013 Custom Action: 基于Site Collection 滚动文字的通知.

    应用场景: 有时候我们的站点需要在每个页面实现滚动文字的通知,怎么在不修改Master Page的情况下实现这个功能?我们可以使用Javascript 和 Custom Action 来实现. 创建一 ...

  3. How to debug Custom Action DLL

    在MSI工程中,经常会遇到这样的情况: MSI 工程需要调用DLL(C++)中的一个函数实现某些特殊或者复杂的功能,通常的做法是在Custom Action 中调用该DLL . 那么在安装过程中,该C ...

  4. Custom Action : dynamic link library

    工具:VS2010, Installshield 2008 实现功能: 创建一个C++ win32 DLL的工程,MSI 工程需要调用这个DLL,并将Basic MSI工程中的两个参数,传递给DLL, ...

  5. Installshield: custom action return value

    参考:MSDN: Custom Action Return Values 参考:MSDN: Logging of Action Return Values

  6. Default Custom Action Locations and IDs

    Default Custom Action Locations and IDs SharePoint 2013                             The following ta ...

  7. SharePoint 2013 - User Custom Action

    1. User Custom Action包含Ribbon和ECB,以及Site Action菜单等,参考此处: 2. 系统默认ECB的Class为: ms-core-menu-box --> ...

  8. Dynamics CRM 2015/2016 Web API:Unbound Custom Action 和 Bound Custom Action

    今天我们再来看看Bound/Unbound Custom Action吧,什么是Custom Action?不知道的小伙伴们就out了,Dynamics CRM 2013就有了这个功能啦.和WhoAm ...

  9. Win7 64X 安装VisualSVNServer 2.6.0过程中出现Custom action InstallWMISchemaExcute failed: Cannot query proxy blanket: No such interface supported (0x80004002)

    Win7 64X 安装VisualSVNServer 2.6.0过程中出现错误:Custom action InstallWMISchemaExcute failed: Cannot query pr ...

随机推荐

  1. Java面试题集(51-70)

    Java程序员面试题集(51-70) 51.类ExampleA 继承Exception,类ExampleB 继承ExampleA. 有如下代码片断: try{ thrownew ExampleB(“b ...

  2. mac磁盘满解决方案

    背景 : 用mac电脑的人,估计都不习惯去关机吧.mac虽然可以不需要关闭电脑,但是久而久之由于应用软件占用产生缓存文件 or 产生虚拟内容交换文件 or 睡眠镜像文件 and so on. 会占用大 ...

  3. PS Studio调用.exe输出错误信息的解决办法

    在一个button_click下调用了如下外部可执行文件: $button1_Click = { #TODO: Place custom script here .\PsExec.exe \\192. ...

  4. 使用 jsPlumb 绘制拓扑图 —— 异步载入与绘制的实现

    本文实现的方法能够边异步载入数据边绘制拓扑图. 有若干点须要说明一下: 1.  一次性获取全部数据并绘制拓扑图. 请參见文章: <使用 JsPlumb 绘制拓扑图的通用方法> ; 本文实现 ...

  5. C# Redis Server分布式缓存编程(二)

    在Redis编程中, 实体和集合类型则更加有趣和实用 namespace Zeus.Cache.Redis.Demo { public class Person { public int Id { g ...

  6. Codeforces Round #200 (Div. 1)D. Water Tree dfs序

    D. Water Tree Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/343/problem/ ...

  7. [RxJS] Subject basic

    A Subject is a type that implements both Observer and Observable types. As an Observer, it can subsc ...

  8. android学习日记20--连接组件之Intent和IntentFilter

    上次刚了解完Android的四大组件,现在学习组件间通信的Intent和IntentFilter 一.Intent 1.简述 Intent(意图)在应用程序运行时连接两个不同组件,是一种运行时的绑定机 ...

  9. js获取光标位置例子

    <html><head><title>TEST</title><style>body,td { font-family: verdana, ...

  10. sqlite数据下载链接地址

    链接: http://pan.baidu.com/s/1pJN1abT 密码: yjg5