I want to install files in different folders, depending on whether the user is selected for installation for all users or only for the current user.
I added the used CreateInputOptionPage () to create the page with two radio buttons.
However, my installer is now littered with a lot of duplicate lines, such as these two:
Source: {
Source: {
Is there a more elegant way to do this? Can Pascal code create a variable like #define so that I can use it instead of {userdocs} and {commondocs} above?
Additional Information:
The IsAllUsers () function above calls this code:
function IsAllUsers: Boolean;
begin
Result := AllUsersInRegistryIsTRUE;
Result := AllUsersOrCurrentUserPage.Values[1]; // wizard page second radio button
end;
and
function AllUsersInRegistryIsTRUE: Boolean;
var
AllUsersRegValue: AnsiString;
begin
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\MyApp', 'AllUsers', AllUsersRegValue) then
Result := (UpperCase(AllUsersRegValue) = 'YES')
else
Result := FALSE;
end;
source
share