I'm writing an installer for my program in Inno Setup. My program uses web pages and Internet Explorer to interact with it.
Some of my queries take longer than 10 seconds, and I noticed on my friends computer that he had a registry key "RequestTimeout" for Internet Explorer that set a timeout of 10 seconds. This key is not naturally present on Internet Explorer, it is apparently added by a third party installer. But from what I read on the web quite a few people end up with it.
My question is, can I tell Inno Setup to delete or modify this key if it is present during setup?
I've googled and all the resources I could find about Inno Setup and Registry Keys have to do with uninstall options.
Ignoring the points about whether you should delete a value that's not "yours", you can easily delete a registry value at install time by setting the type to none
and add the deletevalue
flag:
[Registry]
Root: HKLM; Subkey: "Software\My Company\My Program\Settings"; ValueName: "Value"; ValueType: none; Flags: deletevalue;
You can also add a Check:
parameter and other conditional statements.
For the completeness:
Inno Setup is by default a 32 bit app. So, by default, it will delete the 32bits registry keys even on 64 bits architecture. For deleting 64 bit keys, you have to use the 64 bits constants (like Root: HKLM64
for HKey_Local_Machine).
More info here: Writing 32/64-bit specific registry key at the end of the installation
In the inno setup help there are a few functions listed which you can use for that
function RegDeleteKeyIncludingSubkeys(const RootKey: Integer; const SubkeyName: String): Boolean;
function RegDeleteKeyIfEmpty(const RootKey: Integer; const SubkeyName: String): Boolean;
function RegDeleteValue(const RootKey: Integer; const SubKeyName, ValueName: String): Boolean;;
You can do this while the initializeWizard or the initializeSetup Mehod, there you can check the values and modify them. Also the comment on your question is correct.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With