最近筆者在制作一安裝程序時遇到需動態建立虛擬目錄的問題
筆者就是幾次調試都沒通過(能力有限
procedure TForm
var
RegODBC:TRegistry;
registerTemp : TRegistry;
SysPath: array [
begin
RegODBC:=TRegistry
RegODBC
RegODBC
getsystemdirectory(SysPath
if regodbc
begin
suimessage
suimessage
suimessage
suimessage
if suimessage
winexec(pchar(SysPath+
exit;
end
else
begin
registerTemp := TRegistry
with registerTemp do
begin
RootKey:=HKEY_LOCAL_MACHINE;//設置根鍵值為HKEY_LOCAL_MACHINE
//找到或創建\SYSTEM\ControlSet
if OpenKey(
begin
WriteString(
end
else//創建鍵值失敗
begin
suimessage
suimessage
suimessage
suimessage
if suimessage
application
end;
CloseKey;
Free;
end;
end;
RegODBC
end;
說明
From:http://tw.wingwit.com/Article/program/Delphi/201311/25073.html