Use VC to do your own professional installation procedure

zhaozj2021-02-11  168

Due to the last huge losses, hundreds of words on this article explain that all of them is a bubble. Next time I have time I take time to recover, now I only provide download and preview. : ~~~ (嘻嘻 :) I am too lazy, the same thing can only be done again, I have to do more, it is the life, this is not a way! Throughout (this word is too big :) All have seen the installer, the installation in some common floors is just a simple file to copy. The most professional installer is the number of installshield we have, which has a commonly used a large number of dialogs to you to choose, and use the scripting language to make you interact with the user's operation like programming, proficiently, can be arbitrary Customize the installer you want, the entire process can define the order yourself. (Of course, I have a good understanding of it.) This is what the comrades who want to do their own installation procedures have learned what we should do next. My installer is also mimicing installshield. Considering the details, first is to draw a large number of dialogs (this is said), the method I use is to use some programs that can view exe, DLL, etc. (Vc). Use it to open an installshield installer, directly copy dialogue resources into your application, and then modify the string you want to modify. The next thing is our extent to the various controls (some simple such as cbutton, I will not talk about :) Your own control. It is generally modified on the basis of existing controls. If CTREECTRL implements Check, it has a check box, but it is too ugly. So I want to customize one. Draw every item icon with Cimagelist in CTreeCtrl. Through this we can realize your own Check box. CIMAGELIST * image; image = new cimagelist (); Image-> Create (13, 13, true, 4, 4); image-> add (afxgetApp () -> loadicon (idi_not_checked)); // No selected iconimage- > Add (AFXGetApp () -> LoadCon (IDi_CHECKED)); // All IconImage-> add (AFXGetApp () -> Loadicon (IDi_CHECKED_PART)); // Only part of ICONM_TREE.SetImageList (Image, Lvsil_NORMAL); Then use a CuintArray to record the status of each Item. Of course, we have to inherit a new CTREECTRLEX from the original CTreeCtrl to overload its InsertItem method. The initial state of this dynamic unsigned integer array, this value is 0 or 1, indicating that the selection is not selected. The remaining ICON is only used to represent the status of the parent. Alone, there is no one in the following options with only 0 or 1 state. Then each DBLCLK tree will first change the corresponding status value, assume that it is uState, and then m_tree.setitemimage (HITEM, USTATE, USTATE); then our purpose is achieved. 2. See the "Wizard dialog" such as InstallShield (many programs), which is booted by the previous step and the next step. It feels very convenient.

How is this implementation? I found a CWIZARDDLG Wizard dialog in the programmer's large CD, which is very convenient. For details, see the source code 936k. 3. For a large number of setting information, the method is to be saved, the method is flexible. Because the user can set or modify the installation options any click on the previous step and the next step. Here I use INI files. A few difficulties are as follows. I want to see my article and download source code. You can do some modifications on the existing basis to make the personal installer to adapt to yourself 2. There are some common controls in the source code, you can learn from. The article and code are not very good, please forgive me! Download 937K Preview The original procedure is written, and later BOSS changed his mind and rewritten again. Below is a introduction to the new installer, very beautiful.

The original installer didn't know if you have seen it, now this is the final version after the art, it is very beautiful :)

The installer download 1.19M is a lot of modifications to the original done, whether it is from fancy or from stability. Very nice! There is a Dde.cpp inside, which is used to build a program group.

I don't know how everyone has done an anti-installation, anyway, I haven't done it. Why do you take it out of it alone because there is such a special situation. Generally anti-installation procedure, first to see us this

The procedure to be reversed is involved, such as registry, ini file, program group, etc. (these stasis we remember to restore them to the state before the installation). One of them must be done is to delete the content you go from the user's hard drive. In order to delete the entire installed directory, we generally write a function similar to the DELTREE similar to the original DOS command (because the reasons for the directory is due to the existence of the subdirectory).

Uninstaller download 34K

But when installation, the anti-installation program should also be in the installation directory (forced to the main program). At this time, if the user wants to uninstall the program, a system error will appear because our anti-installer should delete yourself :) and the program is at this time.

It is called. Therefore, it cannot be handled simply. : ~~~

At the end, I want to avoid this problem, I want to make a tag, my method is to generate a file in the temporary folder, first look at the temporary folder.

Is there a specified file. If so,

The copy is running. If you don't make yourself to the temporary folder, then execute a copy first, then yourself.

After the copy program is completed, remove the tag (murderer :).

This is ok, is it very simple? In fact, the procedure is not only technique, and the idea is also very important! Take the game,

<< Civilization >> I don't know if you have played, it is useless to use very high technology.

Just just, I know another more perfect way to delete the EXE file of this process before the end of the process. Take away from

LU 0.126.com, please see my repost, please

Delete the exe file that will start Process before Process

转载请注明原文地址:https://www.9cbs.com/read-5070.html

New Post(0)