A cross-operating system application installation method, system and storage medium

Through XML-based installation scripts, the standardization and automation of the application installation process across operating systems is achieved, and the problem of low installation efficiency of cross-operating system applications in the existing technology is solved, and the installation efficiency and success rate are improved.

CN119292616BActive Publication Date: 2025-04-15福建新意科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411361158.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-04-15
Estimated Expiration
2044-09-27

AI Technical Summary

Technical Problem

The existing technology lacks a unified execution method in the application installation scenarios of cross-operating systems, resulting in low application installation efficiency of cross-platform software.

Method used

By defining an XML-based installation script, including environmental inspection, file upload, file decompression, configuration file replacement and file deletion steps, a unified cross-operating system application installation method is provided.

Benefits of technology

It realizes the standardization and automation of application installation processes across operating systems (Linux and Windows systems), improves installation efficiency, simplifies the installation process, and reduces the risk of human errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292616B_ABST
    Figure CN119292616B_ABST
Patent Text Reader

Abstract

A cross-operating system application installation method, system and storage medium, comprising: obtaining an XML installation script; checking whether the XML installation script complies with instruction syntax requirements; and <steps>The execution order of the node definition is to sequentially execute the installation steps including environment check, file upload, file decompression, configuration file replacement and file deletion steps to complete the application installation. The present invention realizes the standardization and automation of the application installation process across operating systems (Linux and Windows systems) by defining an XML-based installation script, provides a unified execution method for the application installation process across operating systems, and improves the installation efficiency.< / steps>
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, system and storage medium for installing a cross-operating system application. Background Art

[0002] With the rapid development of technologies such as cloud computing, big data, and the Internet of Things, distributed applications have become the mainstream model for modern software development and installation. Distributed applications achieve high availability, high concurrent processing capabilities, and good scalability by splitting large applications into multiple small applications and installing them on different physical or virtual nodes.

[0003] In modern IT environments, applications may need to be installed on multiple operating systems, such as Windows, Linux, and macOS. Each operating system has its own characteristics, such as file systems, permission models, and network configurations, which poses challenges to the cross-operating system installation of applications. Based on the above background, it is particularly important to develop a cross-operating system application installation method.

[0004] Ansible, a popular automated deployment tool on the market, has the following defects and shortcomings in cross-operating system application installation:

[0005] 1. It is difficult to ensure environmental consistency: It is difficult for Ansible to maintain consistency in environmental configuration on different operating systems, especially in scenarios where precise control of environmental variables is required, which requires more manual intervention.

[0006] 2. Platform limitations: Ansible's modules on some operating systems (such as Windows) may not be as mature or functional as on Linux, limiting its wide cross-platform application.

[0007] 3. High learning cost: Although Ansible's syntax is relatively simple, beginners need to spend time familiarizing themselves with its modules, commands, and variable usage, as well as advanced features such as Playbook writing and Inventory management, which increases the steepness of the learning curve.

[0008] 4. Limited ability to handle complex tasks: Although Ansible provides a wealth of modules and plug-ins, when handling complex tasks, it may be necessary to write a large amount of Playbook code or develop custom plug-ins, which increases the difficulty and cost of implementation, especially in scenarios with high requirements for automation tools.

[0009] In summary, the prior art lacks a unified execution method in the cross-operating system application installation scenario, resulting in low efficiency in the cross-platform software application installation. Summary of the invention

[0010] The main purpose of the present invention is to provide a cross-operating system application installation method, system and storage medium, aiming to solve the technical problem that the prior art lacks a unified execution method in the cross-operating system application installation scenario, resulting in low application installation efficiency for cross-platform software.

[0011] To achieve the above object, the present invention provides a cross-operating system application installation method, which includes the following steps: obtaining an XML installation script, which defines all instructions in the installation process; checking whether the XML installation script meets the instruction syntax requirements, and the instruction syntax requirements at least include: all instructions are located in <steps>The tag name is consistent with the instruction name; all instructions conform to XML syntax requirements; the configuration file must contain <rules>Node, and <rules>Exists in the node <replace>Node to describe the replacement rule; according to <steps>The execution order of the node definition is to execute the installation steps including environment check, file upload, file decompression, configuration file replacement and file deletion steps in sequence to complete the application installation.

[0012] Optionally, the environment check step detects whether the target environment has JVM and JDK installed by executing environment check instructions; the file upload step uploads the file to the specified server by executing file upload instructions; the file decompression step decompresses the file of the client instance to the specified directory by executing file decompression instructions; the configuration file replacement step executes the corresponding service replacement rule by executing the configuration file replacement instruction; the file deletion step deletes the file by executing the file deletion instruction.

[0013] Optionally, the operating system includes at least one of Windows and Linux. The label name is <steps>The name of the child node under the node.

[0014] Optionally, the environment check step includes: executing the jps command, and detecting whether jps is installed by returning the result. If not, returning environment check failure; if so, executing the java-version command, and detecting whether jdk is installed by returning the result. If not, returning environment check failure; if so, executing the file upload step.

[0015] Optionally, the file uploading step includes: if the current operating system is a Windows system, creating a file path through a function in the Windows SDK for checking and creating a directory path or recursively calling a C underlying function, and uploading the file using a standard C file operation function; if the current operating system is a Linux system, creating a file path through a recursive call to a C underlying function, and uploading the file using a standard C file operation function.

[0016] Optionally, the file decompression step includes: if the current operating system is a Windows system, creating a file path by recursively calling a C underlying function according to the file path defined by the file decompression instruction and the target file content; creating a target path by using a function in the Windows SDK for checking and creating a directory path; using the self-encapsulated CFileZipper class to decompress the compressed file to the target path; if the current operating system is a Linux system, determining whether the compressed file in the file decompression instruction exists, if not, returning a decompression failure and indicating that the file does not exist; if so, creating a file path by recursively calling a C underlying function, and using the self-encapsulated CFileZipper class to decompress the compressed file to the target path.

[0017] Optionally, the configuration file replacement steps are as follows: <rules>All nodes under <replace>nodes, and all <replace>The node is converted into a replacement rule; the files under each replacement rule are traversed, and if the file does not exist, the replacement failure is returned; the file to be replaced is replaced with the configured content according to the replacement rule.

[0018] Optionally, the file deletion step includes: if the current operating system is a Windows system, determining whether the backup source file exists, if not, returning success and indicating that the file does not exist; if yes, deleting the file through the DeleteFile function of the Windows SDK; if the current operating system is a Linux system, determining whether the backup source file exists, if not, returning success and indicating that the file does not exist; if yes, deleting the file through the C underlying function remove and returning deletion success.

[0019] Corresponding to the cross-operating system application installation method, the present invention provides a cross-operating system application installation system, which includes: a script acquisition module, which acquires an XML installation script, which defines all instructions in the installation process; a script parsing module, which is used to check whether the XML installation script meets the instruction syntax requirements, and the instruction syntax requirements at least include: all instructions are located in <steps>The tag name is consistent with the instruction name; all instructions conform to XML syntax requirements; the configuration file must contain <rules>Node, and <rules>Exists in the node <replace>Node to describe the replacement rules; cross-platform compatible module for <steps>The execution order of the node definition is to execute the installation steps including environment check, file upload, file decompression, configuration file replacement and file deletion steps in sequence to complete the application installation.

[0020] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium, on which a cross-operating system application installation program is stored, and when the cross-operating system application installation program is executed by a processor, the steps of the cross-operating system application installation method described above are implemented.

[0021] The beneficial effects of the present invention are:

[0022] (1) Compared with the prior art, the present invention achieves standardization and automation of the application installation process across operating systems (Linux and Windows systems) by defining an XML-based installation script, provides a unified execution method for the application installation process across operating systems, improves installation efficiency, and eliminates the need for developers to write different scripts for different operating systems; in addition, the syntax checking mechanism ensures the accuracy and reliability of the installation script, and the subsequent <steps>The node-defined order of execution of installation steps not only simplifies the installation process, but also improves installation efficiency and success rate, and reduces the risk of human error;

[0023] (2) Compared with the prior art, the present invention ensures that the JVM and JDK environments required for application operation are correctly installed through the environment checking step, thus avoiding installation failures caused by environment mismatch; the file uploading and decompression steps realize automatic transmission and decompression of the installation package, thus reducing the complexity of manual operations; the configuration file replacement step automatically adjusts the configuration file according to predefined rules, thus ensuring the adaptability of the application in different environments; the file deletion step cleans up temporary files generated during the installation process, thus keeping the target environment clean;

[0024] (3) Compared with the prior art, the present invention provides an efficient and reliable environment inspection method by executing the jps and java-version commands to detect the installation status of JVM and JDK. This inspection method is not only applicable to multiple operating systems, but also can timely discover and solve environmental configuration problems, thereby ensuring the smooth progress of the application installation process;

[0025] (4) Compared with the prior art, the present invention adopts different implementation methods for the file uploading step for different operating systems (Windows and Linux systems). This cross-platform implementation method ensures the compatibility and stability of the file uploading step on different operating systems, and provides strong support for the installation of applications across operating systems;

[0026] (5) Compared with the prior art, the file decompression step of the present invention also provides different implementation methods for Windows and Linux systems, ensuring that the compressed file can be accurately decompressed to the specified directory, thereby improving the reliability and stability of the decompression process;

[0027] (6) Compared with the prior art, the present invention uses the configuration file replacement step to parse the XML script. <rules>and <replace>Node, realizes the automatic replacement of configuration files, which not only improves the accuracy and efficiency of replacement, but also reduces the risk of human error. At the same time, by traversing the files under each replacement rule and checking their existence, it ensures that the replacement operation can proceed smoothly and avoids replacement failures caused by non-existence of files;

[0028] (7) Compared with the prior art, the file deletion step of the present invention provides different implementation methods for different operating systems, ensuring that temporary files and backup files can be cleaned up in a timely manner. This cross-platform implementation method not only improves the efficiency and reliability of file deletion, but also keeps the target environment clean and orderly. At the same time, by checking the existence of the backup source file to decide whether to perform the deletion operation, the risk of accidentally deleting important files is avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0030] Figure 1 A simplified flowchart of an embodiment of a method for installing an application across operating systems of the present invention;

[0031] Figure 2 A framework diagram of an embodiment of a cross-operating system application installation system of the present invention. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0033] like Figure 1 As shown, a cross-operating system application installation method of the present invention includes the following steps: obtaining an XML installation script, which defines all instructions in the installation process; checking whether the XML installation script meets the instruction syntax requirements, and the instruction syntax requirements at least include: all instructions are located in <steps>The tag name is consistent with the instruction name; all instructions conform to XML syntax requirements; the configuration file must contain <rules>Node, and <rules>Exists in the node <replace>Node to describe the replacement rule; according to <steps>The execution order of the node definition is to execute the installation steps including environment check, file upload, file decompression, configuration file replacement and file deletion steps in sequence to complete the application installation.

[0034] In this embodiment, the tag name must be consistent with the instruction name. For example, the tag name of the upload-file instruction (upload file instruction) is <upload-file>.

[0035] The present invention defines an XML-based installation script to achieve standardization and automation of the application installation process across operating systems (Linux and Windows systems), provides a unified execution method for the application installation process across operating systems, improves installation efficiency, and eliminates the need for developers to write different scripts for different operating systems; in addition, the syntax checking mechanism ensures the accuracy and reliability of the installation script, and the subsequent <steps>The node-defined order of execution of installation steps not only simplifies the installation process, but also improves installation efficiency and success rate and reduces the risk of human error.

[0036] In this embodiment, the operating system includes at least one of Windows system and Linux system; the label name is <steps>The name of the child node under the node.

[0037] In this embodiment, the environment check step detects whether the target environment has JVM and JDK installed by executing an environment check instruction (env-check).

[0038] In order to more clearly explain the environment check instruction (env-check), the usage of the environment check instruction (env-check) is provided in this embodiment as follows:

[0039] <steps>

[0040] <env-check> JVM< / env-check>

[0041] < / steps>

[0042] The command parameters are: <env-check>< / env-check> The parameters between indicate the application to be checked.

[0043] The present invention ensures that the JVM and JDK environments required for application operation are correctly installed through the environment checking step, thereby avoiding installation failure caused by environment mismatch.

[0044] In this embodiment, the file uploading step uploads the file to the designated server by executing the file uploading instruction.

[0045] In order to more clearly explain the file upload instruction (upload-file), the usage of the file upload instruction (upload-file) is provided in this embodiment as follows:

[0046] <steps>

[0047] <upload-file from="C: / DFA / UPLOAD / 1.txt" to=" / Users / sysuser / 1.txt">< / upload-file>

[0048] < / steps>

[0049] Instruction parameters: from: the file path to be transferred on the server instance, to: the target address path to save the file on the client instance.

[0050] In this embodiment, the file decompression step decompresses the files of the client instance to a specified directory by executing a file decompression instruction.

[0051] In order to more clearly explain the file decompression instruction (unzip-file), the usage of the file decompression instruction (unzip-file) is provided in this embodiment as follows:

[0052] <steps>

[0053] <unzip-file from="C: / DFA-BMS / DFA-BMS_EMB.zip" to="C: / DFA-BMS / ">< / unzip-file>

[0054] < / steps>

[0055] Instruction parameters: from: the compressed package path to be decompressed on the client instance, to: the target address to be decompressed on the client instance.

[0056] The present invention realizes automatic transmission and decompression of the installation package through the file uploading and decompression steps, thereby reducing the complexity of manual operation.

[0057] In this embodiment, the configuration file replacement step executes the corresponding service replacement rule by executing the configuration file replacement instruction.

[0058] In order to more clearly illustrate the configuration file replacement instruction (exec-rules), the configuration file replacement instruction (exec-rules) usage is provided in this embodiment as follows:

[0059] <steps>

[0060] <exec-rules>< / exec-rules>

[0061] < / steps>

[0062] <rules>

[0063] <replace type="file">

[0064] <file> C: / DFA / DFA-BMS / conf / application.properties< / file>

[0065] <keys>

[0066] <key> nacos.inetutils.ip-address< / key>

[0067] <value> 10.168.1.1< / value>

[0068] < / keys>

[0069] < / replace>

[0070] < / rules>

[0071] Instruction parameters: replace type: the type of file to be replaced, file: the path of the file to be replaced, Key: the item to be replaced, Value: the target value to be replaced.

[0072] The present invention automatically adjusts the configuration file according to predefined rules through the configuration file replacement step, thereby ensuring the adaptability of the application in different environments.

[0073] In this embodiment, the file deletion step deletes the file by executing a file deletion instruction.

[0074] In order to more clearly illustrate the configuration file deletion instruction (delete-file), the configuration file deletion instruction (delete-file) usage is provided in this embodiment as follows:

[0075] <steps>

[0076] <delete-file> C: / DFA / test.xlsx< / delete-file>

[0077] < / steps>

[0078] Command parameters: <delete-file>< / delete-file> The parameters between the two represent the paths of the files to be deleted.

[0079] The present invention cleans up temporary files generated during the installation process through a file deletion step, thereby keeping the target environment clean and tidy.

[0080] Preferably, the installation steps including environment check, file upload, file decompression, configuration file replacement and file deletion are performed in sequence. Specifically, the environment check instruction is executed first, the file upload instruction is executed after the environment check instruction is successfully executed, the file decompression instruction is executed after the file upload instruction is successfully executed, the configuration file replacement instruction is executed after the file decompression instruction is successfully executed, and the file deletion instruction is executed after the configuration file replacement instruction is successfully executed.

[0081] In this embodiment, the execution steps of the environment check instruction on the Windows system and the Linux system are the same, and the execution steps of the configuration file replacement instruction on the Windows system and the Linux system are the same.

[0082] In this embodiment, the environment check step includes: executing the jps command, and detecting whether jps is installed by returning the result. If not, returning the environment check failure; if so, executing the java-version command, and detecting whether jdk is installed by returning the result. If not, returning the environment check failure; if so, executing the file upload step.

[0083] The present invention detects the installation status of JVM and JDK by executing jps and java-version commands, providing an efficient and reliable environment checking method. This checking method is not only applicable to multiple operating systems, but also can timely discover and solve environmental configuration problems, thereby ensuring the smooth progress of the application installation process.

[0084] In this embodiment, the file uploading step includes:

[0085] If the current operating system is Windows, the file path is created through the function in Windows SDK for checking and creating directory paths (MakeSureDirectoryPathExists function) or recursively calling the C underlying function (mkdir), and the file is uploaded using the standard C file operation function, specifically using fopen and fwriter to create and write file information. In C language, the fopen and fwrite functions are usually used to open files and write data to files. These two functions are part of the standard C library (stdio.h and stdlib.h);

[0086] If the current operating system is Linux, the file path is created by recursively calling the C underlying function, and the file is uploaded using the standard C file operation function, specifically using fopen and fwriter to create and write file information.

[0087] The present invention adopts different implementation methods for the file uploading step for different operating systems (Windows and Linux systems). This cross-platform implementation method ensures the compatibility and stability of the file uploading step on different operating systems, and provides strong support for the application installation across operating systems.

[0088] In this embodiment, the file decompression step includes:

[0089] If the current operating system is Windows, the file path is created by recursively calling the C underlying function (mkdir) according to the file path defined by the file decompression instruction and the target file content; the target path is created by using the function (MakeSureDirectoryPathExists function) in the Windows SDK for checking and creating directory paths; the compressed file is decompressed to the target path using the self-encapsulated CFileZipper class;

[0090] If the current operating system is Linux, stat is used to determine whether the compressed file in the file decompression instruction exists. If not, a decompression failure is returned, indicating that the file does not exist. If so, a file path is created by recursively calling the C underlying function (mkdir), and the compressed file is decompressed to the target path using the self-encapsulated CFileZipper class.

[0091] The file decompression step of the present invention also provides different implementation methods for Windows and Linux systems, ensuring that the compressed files can be accurately decompressed to the specified directory, thereby improving the reliability and stability of the decompression process.

[0092] In this embodiment, the configuration file replacement step is specifically: parse in order <rules>All nodes under <replace>nodes, and all <replace>The node is converted into a replacement rule; the files under each replacement rule are traversed, and if the file does not exist, the replacement failure is returned; the file to be replaced is replaced with the configured content according to the replacement rule.

[0093] The present invention replaces the configuration file step by parsing the XML script. <rules>and <replace>Node, realizes the automatic replacement of configuration files, which not only improves the accuracy and efficiency of replacement, but also reduces the risk of human error. At the same time, by traversing the files under each replacement rule and checking their existence, it ensures that the replacement operation can proceed smoothly and avoids replacement failures caused by non-existence of files.

[0094] In this embodiment, the file deletion step includes:

[0095] If the current operating system is Windows, the C underlying function stat is used to determine whether the backup source file exists. If not, success is returned and it indicates that the file does not exist. If so, the file is deleted through the DeleteFile function of the Windows SDK.

[0096] If the current operating system is Linux, the C underlying function stat is used to determine whether the backup source file exists. If not, a success message is returned, indicating that the file does not exist. If so, the file is deleted through the C underlying function remove, and a deletion success message is returned.

[0097] The file deletion step of the present invention provides different implementation methods for different operating systems, ensuring that temporary files and backup files can be cleaned up in time. This cross-platform implementation method not only improves the efficiency and reliability of file deletion, but also keeps the target environment clean and orderly. At the same time, by checking the existence of the backup source file to decide whether to execute the deletion operation, the risk of accidentally deleting important files is avoided.

[0098] like Figure 2 As shown, the present invention also provides a cross-operating system application installation system, which includes: a script acquisition module 10, which acquires an XML installation script, which defines all instructions in the installation process; a script parsing module 20, which is used to check whether the XML installation script meets the instruction syntax requirements, and the instruction syntax requirements at least include: all instructions are located in <steps>The tag name is consistent with the instruction name; all instructions conform to XML syntax requirements; the configuration file must contain <rules>Node, and <rules>Exists in the node <replace>Node to describe the replacement rules; cross-platform compatibility module 30, used according to <steps>The execution order of the node definition is to execute the installation steps including environment check, file upload, file decompression, configuration file replacement and file deletion steps in sequence to complete the application installation.

[0099] The embodiment of the present invention further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the memory in the above embodiment; or a computer-readable storage medium that exists independently and is not installed in a device. The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to implement Figure 1 The computer-readable storage medium may be a read-only memory, a disk or an optical disk, etc.

[0100] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system embodiment and the storage medium embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0101] Furthermore, in this document, the terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of additional identical elements in the process, method, article, or device that includes the element.

[0102] The above description shows and describes the preferred embodiments of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the invention, through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall not depart from the spirit and scope of the present invention, and shall be within the scope of protection of the claims attached to the present invention.< / steps> < / replace> < / rules> < / rules> < / steps> < / replace> < / rules> < / replace> < / replace> < / rules> < / steps> < / steps> < / steps> < / replace> < / rules> < / rules> < / steps> < / replace> < / rules> < / steps> < / steps> < / replace> < / rules> < / rules> < / steps> < / replace> < / replace> < / rules> < / steps> < / steps> < / replace> < / rules> < / rules> < / steps>

Claims

1. A cross-operating system application installation method, characterized in that: The following steps are involved: Get the XML installation script, which defines all the instructions during the installation process; Check whether the XML installation script complies with the command syntax requirements. The command syntax requirements include at least: all commands are located in <steps>The tag name is consistent with the instruction name; all instructions conform to XML syntax requirements; configuration file replacement instructions must contain <rules>Node, and <rules>Exists in the node <replace>The node is used to describe the replacement rule; the operating system includes at least one of Windows and Linux; the label name is <steps> The name of the subnode under the node;< / steps> < / replace> < / rules> < / rules> < / steps> according to <steps> The execution order of the node definition is to execute the installation steps including environment check, file upload, file decompression, configuration file replacement and file deletion steps in sequence to complete the application installation;< / steps> The specific steps for replacing the configuration file are: Parse in order <rules>All nodes under <replace>nodes, and all <replace> Nodes are converted into replacement rules;< / replace> < / replace> < / rules> Traverse the files under each replacement rule. If the file does not exist, return replacement failure; Replace the files to be replaced with the configured contents according to the replacement rules; The environmental inspection steps include: Execute the jps command and check whether the JVM is installed by the returned result. If not, it returns that the environment check failed. If yes, execute the java-version command and check whether the jdk is installed by the returned result. If not, it returns that the environment check failed. If yes, execute the file upload step. The steps for uploading a file include: If the current operating system is Windows, use the function in Windows SDK to check and create the directory path or recursively call the C underlying function to create the file path, and use the standard C file operation function to upload the file; If the current operating system is Linux, the file path is created by recursively calling the C underlying function, and the file is uploaded using the standard C file operation function.

2. The cross-operating system application installation method according to claim 1, characterized in that: The environment check step detects whether the target environment has JVM and JDK installed by executing the environment check instruction; The file upload step uploads the file to the specified server by executing the file upload instruction; The file decompression step decompresses the files of the client instance to the specified directory by executing the file decompression command; The configuration file replacement step executes the corresponding configuration file replacement rule by executing the configuration file replacement instruction; The file deletion step deletes the file by executing the file deletion instruction.

3. The cross-operating system application installation method according to claim 1, characterized in that: The steps to unzip the file include: If the current operating system is Windows, the file path is created by recursively calling the C underlying function according to the file path defined by the file decompression instruction and the target file content, or by using the function in the Windows SDK for checking and creating directory paths; the compressed file is decompressed to the target path using the self-encapsulated CFileZipper class; If the current operating system is Linux, determine whether the compressed file in the file decompression instruction exists. If not, return a decompression failure and indicate that the file does not exist. If so, create a file path by recursively calling the C underlying function, and use the self-encapsulated CFileZipper class to decompress the compressed file to the target path.

4. The cross-operating system application installation method according to claim 1, characterized in that: The file deletion steps include: If the current operating system is Windows, determine whether the backup source file exists. If not, return success and indicate that the file does not exist. If yes, delete the file through the DeleteFile function of Windows SDK. If the current operating system is Linux, determine whether the backup source file exists. If not, return success and indicate that the file does not exist. If yes, delete the file through the C underlying function remove and return a successful deletion.

5. A cross-operating system application installation system, characterized in that: include: The script acquisition module acquires the XML installation script, which defines all the instructions in the installation process; The script parsing module is used to check whether the XML installation script complies with the instruction syntax requirements. The instruction syntax requirements at least include: all instructions are located in <steps>The tag name is consistent with the instruction name; all instructions conform to XML syntax requirements; configuration file replacement instructions must contain <rules>Node, and <rules>Exists in the node <replace>The node is used to describe the replacement rule; the operating system includes at least one of Windows and Linux; the label name is <steps> The name of the subnode under the node;< / steps> < / replace> < / rules> < / rules> < / steps> Cross-platform compatibility module for <steps>The execution order of the node definition is to execute the installation steps including environment check, file upload, file decompression, configuration file replacement and file deletion in sequence to complete the application installation; the configuration file replacement step is as follows: <rules>All nodes under <replace>nodes, and all <replace> The node is converted into a replacement rule; the files under each replacement rule are traversed, and if the file does not exist, replacement failure is returned; the file to be replaced is replaced with the configured content according to the replacement rule; the environment check step includes: executing the jps command, and detecting whether the JVM is installed by returning the result, if not, returning environment check failure; if yes, executing the java-version command, and detecting whether the jdk is installed by returning the result, if not, returning environment check failure, if yes, executing the file upload step; the file upload step includes: if the current operating system is a Windows system, creating a file path through a function in the Windows SDK for checking and creating a directory path or recursively calling a C underlying function, and uploading the file using a standard C file operation function; if the current operating system is a Linux system, creating a file path by recursively calling a C underlying function, and uploading the file using a standard C file operation function.< / replace> < / replace> < / rules> < / steps> 6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a cross-operating system application installation program, and when the cross-operating system application installation program is executed by a processor, the steps of the cross-operating system application installation method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Distributed database deployment method and device

    CN110007934A

  • Method, system, apparatus, and program product for temporary personalization of a computer terminal

    US20070113069A1