procedure InstallNetTime(); Forward;
procedure CreateNTPRegistryEntries(); Forward;
procedure InstallNetTime();
begin
if RegKeyExists(HKEY_LOCAL_MACHINE_32,'SOFTWARE\MICROSOFT\Windows\CurrentVersion\Uninstall\NetTime_is1') then
begin
exit;
end;
ShowStatusMessage('Installing NetTime...');
CreateNTPRegistryEntries();
ExtractTemporaryFile('NetTime-2b7.exe');
RunProcess('{tmp}\NetTime-2b7.exe', '');
end;
procedure CreateNTPRegistryEntries();
begin
RegDeleteKeyIncludingSubkeys ( HKEY_LOCAL_MACHINE_32, 'SOFTWARE\Subjective Software\NetTime');
RegWriteStringValue(HKEY_LOCAL_MACHINE_32, 'SOFTWARE\Subjective
Software\NetTime', 'Hostname', '127.0.0.1');
RegWriteDWordValue(HKEY_LOCAL_MACHINE_32, 'SOFTWARE\Subjective
Software\NetTime', 'Protocol', 2);
RegWriteDWordValue(HKEY_LOCAL_MACHINE_32, 'SOFTWARE\Subjective
Software\NetTime', 'Port', 37);
RegWriteDWordValue(HKEY_LOCAL_MACHINE_32, 'SOFTWARE\Subjective
Software\NetTime', 'SyncFreq', 600);
RegWriteDWordValue(HKEY_LOCAL_MACHINE_32, 'SOFTWARE\Subjective
Software\NetTime', 'LostSync', 7500);
RegWriteDWordValue(HKEY_LOCAL_MACHINE_32, 'SOFTWARE\Subjective
Software\NetTime', 'WarnAdj', 120);
RegWriteDWordValue(HKEY_LOCAL_MACHINE_32, 'SOFTWARE\Subjective
Software\NetTime', 'Retry', 600);
RegWriteDWordValue(HKEY_LOCAL_MACHINE_32, 'SOFTWARE\Subjective
Software\NetTime', 'Server', 1);
end;
I have to do a silent installation that's why I'm using inno scripts.
I am using a ini file for the extra information and calling a RunProcess()
method to pass this ini file as a parameter. First I am extracting the setup and ini file then calling the Runprocess()
method, like below:
ExtractTemporaryFile('ntp-setup-win32.exe');
ExtractTemporaryFile('MeinBergNTP.ini');
RunProcess('msiexec', AddQuotes(ExpandConstant('{tmp}\ntp-setup-win32.exe'))
+ AddQuotes(ExpandConstant('{tmp}\MeinBergNTP.ini'))
+ ' /quiet /norestart');
The second and third lines are executing as i can see the entries of setup into registry. But RunProcess()
method is not working here. Installer just skips this step. I don't have much idea that how to pass the arguments and exe file together as i am new to Inno Scripts and not finding enough docs on it. Please help me out that how should I use the RunProcess()
method. Or How can I silent install using the RunProcess()
method.
RunProcess
function in Inno Setup. If it is your user-defined function, we need to see its code to help you. - Martin Prikrylmsiexec
to run a.exe
file? Themsiexec
is for running.msi
files. You should run.exe
directly. - Martin PrikrylRunProcess
function in IS. It has to be user-defined. Also your new codeRunProcess
call is different to the first code you have posted. Voting to close your question as unclear. - Martin Prikryl