2017年2月23日 星期四

Rebuild wsdl2h with SSL/TLS enabled.

If you want to translates HTTPS's WSDL and XSD files to a gSOAP header file by wsdl2h.exe. You will get below error because wsdl2h.exe is not support SSL/TLS.

Cannot connect to https site: SSL/TLS support not enabled, please rebuild wsdl2h with SSL/TLS enabled using 'make secure' or download the WSDL/WADL and XSD files and rerun wsdl2h on these files directly by specifying the file names on the c ommand line.



To enable SSL/TLS, you can rebuilt wsdl2h.exe using Visual Studio.
1. Install openssl
2. Open wsdl2h.sln (gsoap-2.8\gsoap\VisualStudio2005\wsdl2h)

3. Property Page>Configuration Properties>C/C++>Command Line>Additional Options
    add /DWITH_OPENSSL 
4. Property Page>Configuration Progerties>C/C++>General>Additional Include Directories
    add ssl's include folder
    add plugin floder (gsoap-2.8\gsoap\plugin)
5. Property Page>Configuration Progerties>C/C++>Precompiled Headers>Precompiled Header
    Choose "Not Using Precompiled Headers"
6. Property Page>Configuration Progerties>Linker>General>Additional Library Directories
    add ssl's lib folder
7. Property Page>Configuration Progerties>Linker>Input>Additional Dependencies
    add libeay32.lib and ssleay32.lib

8. Source Files
    add Existing Item httpda.c, smdevp.c and threads.c (copy them from gsoap-2.8\gsoap\plugin)
9. BUILD>Rebuild Solution
10. Copy libeay32.dll and ssleay32.dll (from ssl's bin folder) to wsdl2h\release folder.

Now you can translate HTTPS's WSDL and XSD files to a gSOAP header file by wsdl2h.exe






2017年2月21日 星期二

Install openssl on Windows

openssl提供了TSL/SSL網際網路通訊安全協議的工具包。作者本身開發C/C++環境的Web service工具,在使用到https的網頁時,須引用openssl的library以及header檔。

在安裝前,須先確認開發工具為Win32或是x64。可點選Property頁面檢查Platform。

下載openssl。(下載頁面https://www.openssl.org/source/)
選擇有Long Term Support(LTS)的版本,在此我們下載openssl-1.0.2k.tar.gz。

解壓縮後,可在工具包根目錄下看到安裝說明INSTALL.W32/INSTALL.W64。
以下以W32環境說明
1. 安裝x86版本Perl (http://www.activestate.com/activeperl) ,也就是需在x86作業系統安裝。
2. 開啟 Visual Studio 2008 Command Prompt
> cd openssl folder
> perl Configure VC-WIN32 no-asm
> ms\do_ms
> nmake -f ms\ntdll.mak
> cd out32dll
> ..\ms\test
> cd ..
> nmake -f ms\ntdll.mak install (install to c:\usr)

以上過程執行成功後,會在C:\usr\local下看到ssl資料夾。其中C:\usr\local\ssl\lib以及C:\usr\local\ssl\include需設定在專案所引用的路徑。
以C/C++來說,就是在Property頁面
Configuration Properties>C/C++>General>Additional Include Directoriesr加入C:\usr\local\ssl\include
Configuration Properties>Linker>General>Additional Library Directories加入C:\usr\local\ssl\lib
Configuration Properties>Linker>Input>Additional Dependencies加入libeay32.lib;ssleay32.lib

2016年7月21日 星期四

Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel.

When upgrade windows application. Windows Installer shows error, "Another version of this product is already installed...."















First, check the application version which installed to PC:

Programs and the Features: Version 1.00.0000 is application version in InstallShield.










Project Assistant.
























InstallSample's PRODUCTVERSION is default 1.0.0.1























Install Sample application which show default About Dialog.










Second, modify the application and upgrade it.

Set about's caption to be 1.1.










Set PRODUCTVERSION to be 1.0.0.2























Set Application version to be 1.00.0001.
























Find General Information of InstallShield and generate a new GUID.











New Upgrade Path: Right click Upgrade Paths and new upgrade path.
Open InstallSample.msi


Keep setting and modify Max Version to be 1.00.0003















Rebuild InstallShield and setup application again.
The application was upgraded!


2016年1月8日 星期五

How to check storage size

For android phone, you can find storage size from Settings > Storage


But for developer, this information (16G) is not enough.

Just like we right-click the removable disk and then select "Properties". We can also check the total byte information of android phone storage.

First, enable USB debugging and use adb tool to check emmc size.
$ cd sys/block/mmcblk0
$ cat size
cat size
30785536


The number 30785536 is block number.
Total size is 30785536*512 =  15762194432 bytes