Rev 3 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3 | Rev 5 | ||
---|---|---|---|
Line 55... | Line 55... | ||
55 | Function Wow64DisableWow64FsRedirection(Var Wow64FsEnableRedirection: LongBool): LongBool; StdCall; |
55 | Function Wow64DisableWow64FsRedirection(Var Wow64FsEnableRedirection: LongBool): LongBool; StdCall; |
56 | External 'Kernel32.dll' Name 'Wow64DisableWow64FsRedirection'; |
56 | External 'Kernel32.dll' Name 'Wow64DisableWow64FsRedirection'; |
57 | Function Wow64EnableWow64FsRedirection(Wow64FsEnableRedirection: LongBool): LongBool; StdCall; |
57 | Function Wow64EnableWow64FsRedirection(Wow64FsEnableRedirection: LongBool): LongBool; StdCall; |
58 | External 'Kernel32.dll' Name 'Wow64EnableWow64FsRedirection'; |
58 | External 'Kernel32.dll' Name 'Wow64EnableWow64FsRedirection'; |
59 | 59 | ||
- | 60 | procedure RunAndWaitShell(Executable, Parameter: STRING; ShowParameter: INTEGER); |
|
- | 61 | var |
|
- | 62 | Info: TShellExecuteInfo; |
|
- | 63 | pInfo: PShellExecuteInfo; |
|
- | 64 | exitCode: DWord; |
|
- | 65 | begin |
|
- | 66 | // Source: https://www.delphipraxis.net/31067-shellexecute-wait.html |
|
- | 67 | pInfo := @Info; |
|
- | 68 | with Info do |
|
- | 69 | begin |
|
- | 70 | cbSize := SizeOf(Info); |
|
- | 71 | fMask := SEE_MASK_NOCLOSEPROCESS; |
|
- | 72 | wnd := application.Handle; |
|
- | 73 | lpVerb := NIL; |
|
- | 74 | lpFile := PChar(Executable); |
|
- | 75 | lpParameters := PChar(Parameter + #0); |
|
- | 76 | lpDirectory := NIL; |
|
- | 77 | nShow := ShowParameter; |
|
- | 78 | hInstApp := 0; |
|
- | 79 | end; |
|
- | 80 | ShellExecuteEx(pInfo); |
|
- | 81 | repeat |
|
- | 82 | exitCode := WaitForSingleObject(Info.hProcess, 500); |
|
- | 83 | Application.ProcessMessages; |
|
- | 84 | until (exitCode <> WAIT_TIMEOUT); |
|
- | 85 | end; |
|
- | 86 | ||
60 | procedure RegSvr32(const dll: string); |
87 | procedure RegSvr32(const dll: string); |
61 | begin |
88 | begin |
62 | ShellExecute(Form1.Handle, 'open', 'regsvr32.exe', PChar('"' + dll + '"'), '', SW_NORMAL); |
89 | //ShellExecute(Form1.Handle, 'open', 'regsvr32.exe', PChar('"' + dll + '"'), '', SW_NORMAL); |
- | 90 | RunAndWaitShell('regsvr32.exe', '"'+dll+'"', SW_NORMAL); |
|
63 | end; |
91 | end; |
64 | 92 | ||
65 | procedure TForm1.Button1Click(Sender: TObject); |
93 | procedure TForm1.Button1Click(Sender: TObject); |
66 | var |
94 | var |
67 | rs: TResourceStream; |
95 | rs: TResourceStream; |