Install Sheild에 환경변수를 추가하는 스크립트를 작성하려 합니다.
function MyFunction(hMSI)
// To Do: Declare local variables.
begin
// To Do: Write script that will be executed when MyFunction is called.
addEnviromentVariable("test","C:\test\chartdir51.dll");
end;
function addEnviromentVariable(regKey, regValue)
STRING szRegKey, svValue, szEnv, szPathSet;
number nvType, nvSize, nResult;
begin
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
szRegKey="SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment";
nvType = REGDB_STRING_EXPAND;
nResult = RegDBGetKeyValueEx(szRegKey,regKey, nvType, svValue, nvSize);
if(nResult<0) then
MessageBox(" [Enviroment Variable] Registry Path is incorrect. ",SEVERE);
if(StrFind(svValue, regValue)<0) then
szPathSet = svValue +";"+regValue;
StrReplace(szPathSet, ";;",";",0);
RegDBSetKeyValueEx(szRegKey,regKey,nvType,szPathSet,-1);
endif;
endif;
end;
이렇게 하면 test란 이름으로 C:\test\chartdir51.dll란 path가 생기는거 아닌가요?
정확히 install shield가 어떤 구조로 어떻게 이용하는건지 모르겠습니다.
답변 부탁 드려요~
|