Inno Setup: Removing a problematic registry key le

2019-02-18 19:46发布

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.

3条回答
等我变得足够好
2楼-- · 2019-02-18 19:59

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

查看更多
三岁会撩人
3楼-- · 2019-02-18 20:01

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.

查看更多
不美不萌又怎样
4楼-- · 2019-02-18 20:08

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.

查看更多
登录 后发表回答