What is green software and how to make green software --

Source: Internet
Author: User
What is green software and How to Make It (reprinted )--

The author wrote a strong article about green software.

Definition and classification of green software

After installing the operating system, we usually need to install some commonly used software. However, as the number of commonly used software increases, the installation process becomes increasingly annoying: run setup, and then select the target path, repeat this process constantly. Later, I saw someone making the so-called green software. It was very convenient without installation. At that time, I was very curious and wanted to know how to do it and whether there were any convenient tools and so on. However, I did not find any relevant knowledge on the Internet. As I explored it step by step, I have gradually accumulated some experience and more effective methods, which are provided here.

First, we need to figure out what green software is? What is its definition? I collected some comments and thoughts from some netizens:
A said that no installation is required and nothing is written to the Registry.
B said, it should also include not copying files to the system folder. My understanding is: Installing this software has not changed the existing operating system, including writing the registry.
C. Apart from the directory you have installed, you should not write anything (such as log) anywhere ).
D. No installation is required, and junk files are not generated anywhere outside the directory where the program is located, and the registry is not written.
E said, simply adding one item can be put on the mobile storage and used on any computer with the same effect.
F said, it seems that you don't need to write the Registry. Just copy it and you can use it.
G said that when you reinstall the system, you only need to import the registry, and you do not need to reinstall it, you can think of it as a green software.
H said, as long as you do not write the registry, do not write files to the system folder, even if you need. the INI file can also be included in the software's own directory, so it can be regarded as a green software. The feature is that it can be copied to any folder and can still be used directly after the system is reinstalled or reinstalled without any other changes. Therefore, a small part of the "installation" software is actually in line with the green software, because its installation is just decompression to create a folder.
I said, basically agree, but it is almost impossible not to write the Registry. You just need to run the software and open the Registry Editor HKLM and the software under hklu to see if there is almost always a key value, in fact, this should also be called Green.

Based on the above comments, we can summarize the advantages of the green software, that is, the operating system is not polluted (I am afraid this is also the origin of the green name). It does not need to be installed, so it is easy to uninstall and portable, it can be copied to a portable USB flash drive and run everywhere.

My opinion is that green software should be classified into narrow green and broad Green:
In a narrow sense, green can be called pure green software, which means that the software has not changed any part of the existing operating system. Except for the directory where the software is currently installed, it should not be written anywhere, when you delete a directory, you can directly Delete the Directory, which is similar to most of the previous DOS programs.
In a broad sense, green means that no special installation program is required, and there are few changes to the system. Manual changes can also be easily completed, such as copying several dynamic libraries or importing the registry, the key here is that you can easily complete these changes, or you can use scripts such as batch processing.
Why are there two types? Although green software in the narrow sense is the most ideal, it is rare for software that fully complies with this definition, and a considerable number of software can be divided into green software in the broad sense, this includes the broad concept of green software, which makes the concept of green software more meaningful.
Which of the following do not meet the requirements of green software? It mainly refers to the software that is closely linked and integrated with the operating system. These software is not suitable for making green software. It is best to use the original installation program for installation. For example, IE6 replaces many dynamic libraries in the system. It is difficult and insecure to manually complete this process. For example, for most anti-virus software, if the underlying operation of the system must be monitored in real time and the system is greatly modified, it is not suitable for green software. There are also Microsoft's office series software, which is also closely integrated with the system. However, in the broad sense, this standard is more flexible. If someone finds out the installation and production process of the Office series software, it is also possible to create a green office series in the broad sense.

To fully understand the definition of green software, we must discuss the installation and running processes of modern software.
Installation Process: In the past, there was no such thing as green software in DOS. The installation of the original program was basically a simple copy or decompression, and then configure config. sys and autoexec. BAT file. With the development of windows, the application software is getting bigger and more complex, so some companies specialize in the production of installation programs. For example, Installshield is a relatively famous and widely used installation software, now windwos has a dedicated installer, Microsoft installer. What is the role of the installer? The main purpose is to provide a simple and convenient setup environment for the program to be installed. You do not need to manually complete this step. The more complicated the configuration process, the more modifications the system has, the higher the dependency on the installation program, the easier to learn and use Windows programs are inseparable from the good installation interface, the task of installing software is to provide the application with a ready environment for running without manual configuration.
Running process: When an application starts, it reads the configuration from the registry or configuration file. During running, it can modify the configuration. However, this modification is generally based on the work of installing the software, for example, you cannot change the installation location of the application.
After understanding the differences between the installation process and the running process, it is easy to think of using the green software according to these two stages into the green Installation Process and the green operation process. Green installation is the prerequisite for green running. Without green installation, it cannot be said that green running is the first thing green software must be installed, the green software standards I mentioned earlier cannot be installed in green.
In my opinion, the basic meaning of green installation can be classified into narrow and broad green installation:
1. In a narrow sense, green installation means to directly copy or decompress the package to the target directory, without copying the package to the system directory or writing the Registry. This is the ideal situation, or the installer can be ignored in addition to decompression, such as adding shortcuts to the Start menu and other operations that have little impact on the operation of the system and software, that is to say, the role of the installation process is to copy the file to the target folder.
2. Green installation in the broad sense refers to copying some dynamic libraries to the system directory or importing necessary settings in the Registry on the basis of narrow replication, you may also need to perform other configurations. Otherwise, the application cannot run, and the configuration should be relatively simple, and it is easy to cancel the system changes caused by these operations.
Similarly, green running can be classified into narrow and broad green running:
1. In a narrow sense, green running means that the file and configuration of the operating system are not changed at all during software running-many small programs belong to this category, or the system changes are revoked after the running is completed, for example, if you load a driver during running and exit, uninstall the driver, and the operated INI file is in your program directory.
2. Green running in a broad sense refers to changing the current settings through the program itself, for example, changing the running mode of the current software or associating it with some file suffixes, or leave the current software settings in the registry, that is to say, there are permanent changes to the registry of the system, but these changes are done by the application itself, and do not need to be done by other programs or manually.
Green software can be subdivided:
1. Green installation in a narrow sense and green running software in a narrow sense, without any changes to the operating system.
2. in the narrow sense, the green installation, the green running software, and the configuration of the software are completed by the software itself, not by the installation program.
3. Green installation in a broad sense and green operation in a narrow sense. The configuration of the software is completed by the installer, and the software itself cannot be modified. If no configuration is available, the software cannot run normally.
4. Green installation in a broad sense, green operation in a broad sense, and the most complex green software. The configuration of the software is completed by the installer, but the software can modify the configuration, if no configuration is available, the software cannot run properly.

Only the first category belongs to the narrow sense of green software, and the other three categories belong to the broad scope of green software.

Green Software Method

Next, let's talk about the production of green software, or the "green" of software for short. The production of green software is actually our own installation program. There is no fixed method. Basically, there are different production strategies for different types of green software based on speculation and experimentation.
To get a new software and create a green software, follow these steps:
1. Judgment. It is to guess whether the software can be made into a green software. From the function, from your understanding of it, if you think that the software is closely related to the system, do not continue, the original installer is the most secure and convenient. Such examples include directx9, IE6, and Norton Anti-virus software. Such judgment can save you time. Of course, you can ignore this step and try to make the green software, then go to step 2.
2 "green ". There are no rules for different methods for different software, but in general, it is to understand the software installation process and convert it to green installation. In this process, you may need to try multiple methods, or, in the end, the software may not be green due to the complexity or characteristics of the software. We need to prepare for failure. The specific greening method will be described later.
3 test ." The post-Greening test should be carried out in your newly installed operating system, and if you want to use the software in multiple operating systems, test in other operating systems. Some software files vary with operating systems. In this case, you need to perform the "greening" process in different operating systems, finally, it is integrated into a complete green software that adapts to multiple operating platforms.

For the "greening" method, you need to select different "greening" methods based on experience, or you may need to constantly try different methods until they are successful. According to the order of ease and difficulty, the specific methods include:
1. decompress the package. This is the simplest way, that is, to try to uncompress the software package. Use WinZip and WinRAR to test whether the compressed installation file can be opened directly. If not, use another method. If you can, congratulations. Most of the software is green-installed (with some exceptions, such as emeditor). decompress the files in the compressed package to the target path, then, test whether the software function is normal. If the function is normal, "greening" is successful. If the function is not normal, change the method. This type of software features that the installation of programs can be completed by the software itself.
2. Install and uninstall. It is also a relatively easy method. It is completely manual labor, that is, to directly install the software, copy the program, and finally uninstall the installation program. If the installation program of this software only serves to copy files and generate shortcuts, It is a green installation. You can use this method. Finally, test whether the function of the software is normal. If the function is normal, "greening" is successful. If the function is not normal, change the method.
3. decompile the installer. This method requires brains, that is, based on the production tool used by the installation program, select the corresponding decompilation program, and then read The Decompilation installation script to create the green software. Most of the current software is made using specialized installation tools, such as InstallShield, wise, Inno Setup, Windows Installer, NSIs (Nullsoft), installer vise, here, the installation file in Windows Installer format (that is, the MSI file with the MST suffix) can be opened through Microsoft's free tool orca, installation files in InstallShield format also have many free tools to decompress and view scripts. Of course, there are many specialized installation tools, and many of the installation programs do not have the corresponding decompilation program. In this case, this method cannot be used.
4. Check the uninstaller and log files. The vast majority of current software installations come with the uninstall method. Uninstall is the inverse process of installation. If you know how to uninstall it, you can also determine how to install it. The uninstaller created by a dedicated Installation tool is generally uninstalled based on the information in a file. You can open the file in a plain text editor. In some cases, this file does not contain readable information, so you have to use other methods. The specific process is to first adopt method 2, then understand the anti-installation process, and finally create the green software based on the Anti-installation information.
5. Compare system snapshots. If none of the current methods fail, try this method. The specific idea is to record the system status before installing the software, including all the file statuses in the Registry and system directory. Then install the software. After the installation is complete, record the system status again. The last step is to compare the status of the two systems before and after, and learn the work done by the installer. This work is generally done by specialized software, such as the free tool regshot, the free tool inctrl5 (http://www.pcmag.com/article2/0,4149,9882,00.asp), the Microsoft sysdiff tool (can be obtained from the Windows2000 resource Toolbox ), or wininstall le (in the Windows 2000 Server Directory valueadd/3 rdparty/MGMT/winstle ). In most cases, you only need to compare the registry before and after the installation. In this case, a large number of registry tools are available. After the system differences are obtained, the differences are divided into two parts: the file part and the Registry part. The file part refers to the file copied to the system directory, the file registered as a COM component, and the Registry part related to these files. The registry only refers to the changes of other registries. For the file part, you can further differentiate the files that must be copied to the system directory (which is rare in this case) and files that can be placed in the installation directory of the software. For the registry, registry operations performed by the software installer itself and registry operations performed when the COM component is registered are distinguished, and operations performed by other programs (such as resource manager Explorer) are discarded. Write a copy file, register the COM component, and import the batch file of the Registry to complete the creation of the green software. When the Registry file contains path information, you can manually modify the Registry file or convert the Registry file to the INF file to implement automatic path processing.
6. Export the Registry directly to find the self-registered COM component. This method is the simplified version of Method 5 above, currently, most software configurations are written under the "hkey_loclal_machine/software company name" and "HKEY_CURRENT_USER/software company name" keys in the registry, directly export the two registry keys to the reg file. For self-registered COM components, You need to export the following four functions: dllcanunloadnow, dllgetclassobject, dllregisterserver, and dllunregisterserver. you can use the depend.exe file of vcbit to find out which dynamic link library is a self-registered COM Component. Write a batch of processed files to use regsvr32.exeto register the comkit and use regedit.exe to import the registry.
Through the above analysis of the actions of the installer, the installer is divided into several parts, such as copying files, registering COM components, installing Service drivers, and registry configuration, although the Registry configuration can overwrite the steps for registering COM components and installing the service driver, you can clearly separate these steps to help you make the green installation software. For software that requires more complex steps to install, it is safer to use the original installer.

For each method, I will give a specific example below. Sometimes, several methods are required for joint use. No matter what method is used, the installation process of the original software author is simulated, therefore, the original author is most likely to give the green version of the software.

Examples

Winrar3.30 and winzip9.0, adopt method 1, decompress. This example is very simple. Download winzip90.exeand winrar330sc.exe from the cloud software station, right-click a system with WinRAR installed, select the downloaded file, run the command opened with WinRAR In the context menu, and decompress the file to our target path, e:/tools directory. Set winzip9 and WinRAR respectively. Run winzip32.exe in the winzip9directory to set WinZip. Configure WinRAR one by one. When copying data to a USB flash drive and running it on a new machine, you must repeat these settings.
This type of software features that the installation program can be completely completed by the software itself, so that the installation program is completely put aside, or the installation program is to be decompressed. There are some similar software. The simplest test method is to see if WinRAR can directly open the compressed installer. You can also use method 2. The process is basically the same as method 1.
Method 2 is not described in detail. It only indicates that many programs belong to this category, such as myie2, greenbrowser, QQ, bpftp server, ida_pro_standard_4.5.1.770, finaldata, easyrecovery 6.03, and TM of tengxun.
Flashget is a widely used software. It is convenient to download and manage multiple threads. Download flashget1.60a international edition from sky.com, and run flashget_wise.png, then cancel the installation. From the figure, we can see that flashget1.60a is an installation program made by wise in the international version. Download The wungui program from the Internet and it is very easy to extract the installation program to a directory, flashget160a. PNG. Observe the maindir directory. There are two DLL files, jccatch. DLL and fgiebar. DLL to view the export functions of these two dynamic library files. You can know that these two DLL files are self-registered COM components and write a batch file install. BAT to register these two dll:
Regsvr32 jccatch. dll/s
Regsvr32 fgiebar. dll/s
After testing, the function is normal and flashget can be activated from the Browser IE by right-clicking the menu. The function is complete. The uninstall process is considered below.
Run regedit.exe and find that the path of flashget in the registry is [HKEY_CURRENT_USER/software/jetcar]. Write a Registry File unflashget. reg to delete this path, as shown below:
Regedit4
; Flashget
[-HKEY_CURRENT_USER/software/jetcar]
At the same time, write a batch file Uninstall. BAT to uninstall the two DLL files and import unflashget. Reg:
Regedit unflashget. Reg/s
Regsvr32 jccatch. dll/S/u
Regsvr32 fgiebar. dll/S/u

The next step is to delete some files that we cannot use, such as the vast majority of European language files in the language directory. At this time, this green version is ready. Copy the created green flashget to the USB flash drive. When necessary, directly execute install. you can copy the BAT file (note that you need to run the batch file in the flashget directory) without any file copy.
I have seen some people mention that using the master of optimization to extract the falshget registry and then directly import the Registry to make a green flashget. This is not acceptable. From the previous steps, when registering two DLL files, the absolute path must be introduced in the registry. If you extract the Registry directly, you must modify the path in the registry according to the current path, otherwise, the green version of flashget can only be run in a fixed directory. When I made the flashget green version, I used methods 3 and 6 at the same time. The purpose of method 3 is to prevent the installer from modifying the system, in this way, you can directly test the current system without having to test another system that has not been installed with flashget.

Emeditor is an inverse example of method 1. Emeditor can drag the mouse from the developer's homepage and allow undo and redo without limit. In short, emeditor has many functions and is easy to use. It is the best editor to replace notepad.
After downloading emed404epx.exe, you can use WinRAR to open it. decompress the package and run emeditor. You can find that you have lost the syntax configurations of multiple predefined text formats. It seems that you cannot do this, so you have to use Method 5. Follow the steps below:
1. Scan the system and create system snapshots. Here I only record the registry of the current system (because I don't think emeditor will copy files to the system directory. If the judgment is incorrect, it will cause "greening" failure ), run art (Advanced registery tracer) to scan the registry. Emeditor_snap.png. Do not disable art.
2. Install emeditor. You can uninstall it wherever you install it. After the installation, you can change the configuration or configure a new file type if needed. For example, I have added the nfo file type and set the character set associated with the nfo file, in this way, you can use emeditor to directly view the nfo file without a dedicated inspection tool.
3. record system changes. Scan the system again, take a snapshot of the system, scan the Registry again from art, then select the menu command registry-> compare heregion to directly use the keyboard F10, compare the result emeditor_compare.png, and click the Save to redo file button in the figure, stored as emeditor. reg file, close art.
4. Copy and uninstall the SDK. Copy the installed emeditor directory to another path and uninstall the emeditor program.
5. analysis. Open the exported emeditor. reg file. This is a huge reg file. Only Reg files have more than 1 MB, but don't worry. After reading the registry, delete the registry that is irrelevant to emeditor. For example, if the registry is only related to the resource manager, the remaining registry files can be divided into three parts. Some of them are in the Registry path [HKEY_LOCAL_MACHINE/software/emsoft]. Most of them do not involve paths. Only one of them records the path of emeditor, that is, "modulepath" = "h: // emeditor4 // "; there is also a majority of [HKEY_CURRENT_USER/software/emsoft/emeditor V3] under the Registry path, which contains many items involving the emeditor path, for example, "tmpl" = "H: // emeditor4 // template. XML "; there is also the Registry Settings associated with the extension of the emeditor and TXT files, set emeditor to the default source code check tool registry settings in IE, and register the COM component emedshl. DLL Registry (which is related to inprocserver32 ).
6. "green ".
6.1 store the content in the Registry path [HKEY_LOCAL_MACHINE/software/emsoft] To the emeditor_hklm.reg file, store the content in the Registry path [HKEY_CURRENT_USER/software/emsoft/emeditor V3] To the emeditor_hkcu.reg file, and first remove the remaining content from the COM component emedshl. DLL, and then stored in the emeditor_assoc.reg file.
6.2 extract the Registry content of the paths involved in the emeditor_hklm.reg and emeditor_hkcu.reg files and store them in the emeditorconf. reg file.
6.3 automatic conversion, and then replace the path H:/emeditor4 In the converted emeditor_assoc.inf file and emeditorconf. inf file with % 01%. The content of the emeditorconf. inf file is as follows:
[Version]
Signature = "$ Chicago $"
[Defainstall install]
Addreg = emeditorconf_addreg
[Emeditorconf_addreg]
HKLM, "software/emsoft/emeditor V3/common", "modulepath", "% 01% /"
Hkcu, "software/emsoft/emeditor V3/config/C ++", "tmpl", "% 01%/template. cpp"
Hkcu, "software/emsoft/emeditor V3/config/CSS", "tmpl", "% 01%/template.css"
Hkcu, "software/emsoft/emeditor V3/config/html", "tmpl", "% 01%/template.htm"
Hkcu, "software/emsoft/emeditor V3/config/Java", "tmpl", "% 01%/template. Java"
Hkcu, "software/emsoft/emeditor V3/config/JavaScript", "tmpl", "% 01%/template. js"
Hkcu, "software/emsoft/emeditor V3/config/jsp", "tmpl", "% 01%/template. jsp"
Hkcu, "software/emsoft/emeditor V3/config/Perl", "tmpl", "% 01%/template. pl"
Hkcu, "software/emsoft/emeditor V3/config/PHP", "tmpl", "% 01%/template. php"
Hkcu, "software/emsoft/emeditor V3/config/Python", "tmpl", "% 01%/template. py"
Hkcu, "software/emsoft/emeditor V3/config/ruby", "tmpl", "% 01%/template. RB"
Hkcu, "software/emsoft/emeditor V3/config/tex", "tmpl", "% 01%/template. Tex"
Hkcu, "software/emsoft/emeditor V3/config/VBScript", "tmpl", "% 01%/template. vbs"
Hkcu, "software/emsoft/emeditor V3/config/VBScript for emeditor", "tmpl", "% 01%/template. vbee"
Hkcu, "software/emsoft/emeditor V3/config/Windows Script", "tmpl", "% 01%/template. WSF"
Hkcu, "software/emsoft/emeditor V3/config/XML", "tmpl", "% 01%/template. xml"

6.4 write a batch file install. bat with the following content:
Regedit emeditor_hklm.reg
Regedit emeditor_hkcu.reg
Rundll32.exe setupapi. dll, installhinfsection defaultinstall 128./emeditorconf. inf
Regsvr32 emedshl. dll
Rundll32.exe setupapi. dll, installhinfsection defaultinstall 128./emeditor_assoc.inf
6.5 store the install. bat, emeditorconf. inf, emeditor_assoc.inf, emeditor_hklm.reg, and emeditor_hkcu.reg5 files in the emeditor directory and delete the remaining registry files.
6.6 write the corresponding unmount batch file according to the installation steps and install. bat, which is relatively simple.
After testing, emeditor works normally. You can also comment out install. the last two lines of BAT statement, so that emeditor will not be associated with the system. The above steps are performed on Windows 2000, and the same are true for Win9x, in addition, the emeditor configuration file in Win9x is the same as that in Windows 2000, except that the program version is different.
Copy the green emeditor to the USB flash drive. Run the install command directly when necessary. you can copy the BAT file (note that you need to run the batch file in the emeditor directory) without copying any files. This example demonstrates how to automatically install green and solve the path problem. If you use dozens of similar green software, but you need to manually modify the path, it is hard to remember the paths that need to be modified. Of course, if you can write scripts that automatically replace paths, you can also. I said that the USB flash disk is used to emphasize that the path can be changed. If all the partitions of the machines used are the same, the software is stored in C:, and the registry can be backed up directly, otherwise, you need to manually modify the path, which is easy to modify.

From the above example, we can see that method 2 is basically the same as method 1, except that method 1 uses winrardecompress, and method 2 uses the installer to decompress. Method 6 can be said to be a simplified version of Method 5. Methods 3 and 4 can also assist Method 5, and some need to be applied together. Sometimes it is difficult to determine whether the method is used, the method is dead and needs to be used flexibly. Sometimes it needs to be tested continuously.
I will briefly describe the methods used when software is "green". Some software may have multiple "green" methods, but the final results are basically the same:

Method 1 is not mentioned. If there is no special installer and it is directly published in ZIP format, method 1 is used.
CuteFTP, flashfxp, QQ, foobar, winamp2.8, acrobat, finaldata, Kingsoft, zoomplayer, winiso, isobuster, winiso, mIRC, wincvs, photoshop6, easyrecovery 6.03, and Netease bubble usage method 2.
VisualC ++ 6, Real Player, and RealMedia decoder package. Most decoder packages include VP6, MPEG2, AC3, Ogg, DivX, and XviD.
NetAnts, flashget, offlineexplorer ACDSee, ultraedit, IBM Dictionary, thebat, net fast capture, and current cyberarticle, partitionmagic7 usage method 6.
Directx9, mediaplayer9, IE6, Microsoft patches, office2003, anti-virus tool Nav, Java virtual machine, and virtual machine VMware are not suitable for "greening, some of them do not know how to "green" or are difficult, such as Office 2003. I think the method of installing the Office on the hard disk and then removing the registry change is called "green ", because there are a large number of absolute paths in the Registry file, and there are complicated links between offcie components, it is difficult to "green ". Some of them are "green" and have no significance, such as IE6, Microsoft patches, and directx9.

Currently, most of the software I use is "green", and only a few must be installed, such as MS Office and visual studio.net 2003. It is very convenient, especially when changing the drive letter. It can be portable.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.