U9 Secondary Development Patch Making

patch making

After the second opening of u9 is completed, a patch will be made and released to the server. I will record the process of making the patch for your reference.

1. Restore the database needed to make the patch

Restore the patch library.bak to the database.

insert image description here
insert image description here

2. Configure the environment.xml file

After restoring the database, configure the environment.xml file in the BuildTool directory.

Modify the database connection information to point to the restored database U9Build25_YX_DEV.

You only need to change the database connection information, other parameters do not need to be changed.

<?xml version="1.0" encoding="utf-8" ?> 
<environment>    
    <system>    
	<connectionString>packet size=4096;user id=sa;Connection Timeout=150;Max Pool size=1500;data source=localhost;persist security info=True;initial catalog=U9Build25_YX_DEV;password=123456</connectionString>
    </system>    
    <view>
    	<mapper type="UFSoft.UBF.View.Query.MetadataDomainMapping, UFSoft.UBF.Business.Adapter" />
	<creator type="UFSoft.UBF.View.Query.Adapter.TranslatorCreator, UFSoft.UBF.Business.Adapter" />
    </view>
    <Path>
    	<Metadatalib>d:\</Metadatalib>
    </Path>
    <path>
	<ubfbin>d:\ubf2.0\bin</ubfbin>
	<ubfstudio>d:\ubf20\visual studio</ubfstudio>
	<ubfresources>d:\ubf20\resources</ubfresources>
	<approot>d:\u9app</approot>
    </path>
</environment>

3. Configure the desktopBuild.xml file

Also find the desktopBuild.xml file under the BuildTool folder.

version: the version number of u9, here is 6.0
ProductPath: the directory where the U9 Portal folder is located, that is, the installation directory of u9
ProjectPath: the directory where the patch generated files are placed
Module: the module name of the patch, which can be customized, and generally starts with Cust

Other parameters do not need to be changed.

<?xml version="1.0"?>
<configuration version="6.0">
  <!--U9,HR,CD,TR !-->
  <Domain>CD</Domain>
  <PatchBaseVersion>0</PatchBaseVersion>
  <ProductPath>D:\yonyou\U9V60</ProductPath>
  <ProjectPath>D:\yonyou\U9Project\MKGD\补丁</ProjectPath>
  <FilePath>D:\</FilePath>
  <!--重新构造时是否清空文件夹Y,N-->
  <DelOnRebuild>Y</DelOnRebuild>
  <CustomerNo>TO_BE_Cust</CustomerNo>
  <IsCustomer>1</IsCustomer>
  <Module>Cust_CompanyName</Module>
  <SpNumber>0</SpNumber>
  <IsSP>0</IsSP>
</configuration>

4. New plan

Open the UFIDA.UBF.Build.Engine.DesktopBuild.exe program, click the button to create a new project.

insert image description here

Then click the Build button:

insert image description here

After the construction is complete, many folders will be generated under the directory specified by ProjectPath:

insert image description here

The description of each folder is as follows:

  • AssemblyInfo: Place Setup.bdxml, which is a collection of assembly files for each module
  • Files: Place all files that need to be copied, including all BE/BP/UI/SV dlls, UI/BE plug-in configuration files, and all files that need to be copied to the server Portal
  • Metadata: The files generated by model construction, place the bulk files generated together with the original data script, all the bulk files generated by BE/BP/UI/SV (default is generated under UBF, default path: D:\yonyou\UBFV50\ U9.VOB.Product.Other)
  • PostSQL: all scripts that need to be executed
  • PreScript: It is a collection of preset scripts, that is, scripts that need to be executed first when the patch is first deployed to the server
  • ReportMD: place the report model and print model, mix all xml together, do not create subfolders to store different models (the table creation script generated by the construction does not need to be placed in the patch package, otherwise the original data of the database table will be cleared)

5. Copy files

What I am doing is a BE plug-in, just copy the compiled dll, pdb file and sub.xml file of the BE plug-in project to the Files folder:

insert image description here

6. Generate installation information

Click the Generate Installation Information button:

insert image description here

After the operation is successful, the packageinfo.xml file will be generated in the corresponding directory.

insert image description here

Open the xml file and modify the description information.

insert image description here

For some reason, the dir in the packageinfo.xml file I generated is empty (is it a configuration problem?), I manually added the following dir path:

The dll and pdb files are placed in the \Portal\ApplicationLib path,

The sub.xml file is placed under the \Portal\bin path.

<?xml version="1.0" encoding="UTF-8"?>
<package>
  <baseinfo code="CD6.0.Cust_Canaan.1002208310000003" name="CD6.0.Cust_Canaan.1002208310000003" type="" version="6.0" releasedate="" desc="" question="" doc="" basebuild="" referenceBuild="20090918002" IsCustomer="1" CustomerNo="TO_BE_Cust" Domain="CD" SPNum="0" Modules="Cust_Canaan," DependModules="," IsSP="0" />
  <description>说明</description>
  <descriptiondetail>标准采购插件提交审核时写中间表</descriptiondetail>
  <filelist>
    <file dir="\Portal\ApplicationLib;" exeflag="" servertype="0" filename="UFIDA.U9.Cust.Canaan.PurchaseOrderPlugBE.dll" filetype="0" />
    <file dir="\Portal\ApplicationLib;" exeflag="" servertype="0" filename="UFIDA.U9.Cust.Canaan.PurchaseOrderPlugBE.pdb" filetype="0" />
    <file dir="\Portal\bin;" exeflag="" servertype="0" filename="UFIDA.U9.Cust.Canaan.PurchaseOrderPlugBE.sub.xml" filetype="0" />
  </filelist>
</package>

7. Generate the patch

Click the Generate Patch button to generate the patch.

insert image description here
insert image description here

8. Install the patch

Open the system management tool client, click the patch download and installation sidebar, and then click Import to add your own patch.

insert image description here

Click the submit button after adding:

insert image description here

Then select the patch you added and install it:

insert image description here
insert image description here

at last

The configuration file only needs to be configured once, and it can be used directly in the future. In fact, patching is essentially copying various dll and xml files to different folders on the server. We can copy them manually without patching.

However, the advantage of patching is that historical patch data can be recorded, and it is clear at a glance when and what has been updated.

If all the files are manually copied to the server directory, after a long time, it will be unclear what was updated before, which is not conducive to system maintenance.

Therefore, I still recommend updating the system by patching.

Guess you like

Origin blog.csdn.net/zhanyd/article/details/126607039