Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Setup]
- AppName=My Program
- AppVersion=1.5
- DefaultDirName={pf}\My Program
- [Code]
- #ifdef UNICODE
- #define AW "W"
- #else
- #define AW "A"
- #endif
- const
- MAX_PATH = 260;
- ERROR_SUCCESS = 0;
- AutoCAD2016PC = '{5783F2D7-F004-0000-5102-0060B0CE6BBA}';
- INSTALLPROPERTY_INSTALLLOCATION = 'InstallLocation';
- function MsiGetProductInfo(szProduct: string; szProperty: string;
- lpValueBuf: string; var pcchValueBuf: DWORD): UINT;
- external 'MsiGetProductInfo{#AW}@msi.dll stdcall';
- procedure InitializeWizard;
- var
- RetVal: UINT;
- BufSize: DWORD;
- AppPath: string;
- begin
- BufSize := MAX_PATH;
- SetLength(AppPath, BufSize);
- RetVal := MsiGetProductInfo(AutoCAD2016PC, INSTALLPROPERTY_INSTALLLOCATION, AppPath, BufSize);
- if RetVal = ERROR_SUCCESS then
- MsgBox(AppPath, mbInformation, MB_OK)
- else
- MsgBox('Function failed. Error code: ' + IntToStr(RetVal), mbError, MB_OK);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement