Advertisement
TLama

Untitled

Feb 11th, 2014
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.54 KB | None | 0 0
  1. [Setup]
  2. AppName=My Program
  3. AppVersion=1.5
  4. DefaultDirName={pf}\My Program
  5.  
  6. [Run]
  7. Filename: "{app}\temp\installation_files\license.exe"; BeforeInstall: SetEnvPath;
  8.  
  9. [Code]
  10. #ifdef UNICODE
  11.   #define AW "W"
  12. #else
  13.   #define AW "A"
  14. #endif
  15. function SetEnvironmentVariable(lpName: string; lpValue: string): BOOL;
  16.   external 'SetEnvironmentVariable{#AW}@kernel32.dll stdcall';
  17.  
  18. procedure SetEnvPath;
  19. begin
  20.   if not SetEnvironmentVariable('PATH', ExpandConstant('{app}')) then
  21.     MsgBox(SysErrorMessage(DLLGetLastError), mbError, MB_OK);
  22. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement