How to deal with setupdll during cab Installation

Source: Internet
Author: User

1) obtain the screen resolution

During cab installation, you can use setupDLLDoing some initialization work greatly facilitates ourDevelopment.

However, getsystemmetrics is used in setupdll.FunctionObtainScreenResolution problems occur. 320x240,800 x.

The original cause is not clear. It is said that setupdllis identified by wceload.exe, and wceloade.exe is not capable of obtaining resolution...

No matter what, we have to do another exe.ProgramTo be called by setupdll.

Add the following to install_exit:

Process_information Info;
CreateProcess (L "// program files // getmetricstest.exe", null, 0, null, & info );
Waitforsingleobject (info. hprocess, infinite); // wait until the process ends.

The getmetricstest.exe program is used to obtain the screen resolution. You can save the obtained parameters in the registry or temporaryFileAnd then setupdll to process these parameters.

 

2) Get the installation package name

During the installation of the cab, "installing xx. cab... ". the value between cab and cab achieves our goal.

First, use setupDLLYes, and then perform the action in install_exit. At this time, the hwndparent parameter is passed in, and you can use this parameter to make a try:

Tchar scabname [256];
Hwnd hdlg = getwindow (hwndparent, gw_child | gw_hwndfirst );
Uint uctrlid = getdlgctrlid (hdlg );
Getdlgitemtext (hwndparent, udctrlid, scabname, 256 );

Scabname is exactly "XX. Cab..." or "XX. Cab ...".

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.