Inno Setup Installer for ACAD Plugin Fails to Edit Registry

Inno Setup Installer for ACAD Plugin Fails to Edit Registry

Anonymous
Not applicable
2,422 Views
6 Replies
Message 1 of 7

Inno Setup Installer for ACAD Plugin Fails to Edit Registry

Anonymous
Not applicable
I have an installer for my AutoCAD program that adds the registry keys necessary to load the program into AutoCAD, but on every computer I've tried to install it on other than my own, all registry functions fail. Why would this happen? I suspect it's a permissions issue, but I logged in as administrator on one and it still failed.
0 Likes
2,423 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
Are you asking us to guess what your installer scripts are doing wrong?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:[email protected]...
I have an installer for my AutoCAD program that adds the registry keys necessary
to load the program into AutoCAD, but on every computer I've tried to install it
on other than my own, all registry functions fail. Why would this happen? I
suspect it's a permissions issue, but I logged in as administrator on one and it
still failed.
0 Likes
Message 3 of 7

Anonymous
Not applicable
No. I was wondering if there are any known issues with Inno Setup that would cause this. It runs perfectly on my machine (adds files to the program folder and adds the registry keys), but fails on other machines, even with administrative privileges. I will attach the file this time, but I don't know that it will help because it works on my machine.

{code}
[Code]
var
Names: TArrayOfString;
ACADVer: String;
ACADLang: String;
RegSubkey: String;
I: Integer;
S: String;
function InitializeSetup(): Boolean;
begin
Result:= True
(* find correct subkey using a for loop and RegGetSubkeyNames (should start with R) *)
if RegGetSubkeyNames(HKEY_CURRENT_USER, 'Software\\Autodesk\\AutoCAD', Names) then
begin
MsgBox('Got Subkey Names', mbInformation, MB_OK);
for I := 0 to GetArrayLength(Names)-1 do
S:= Names;
ACADVer:= S
MsgBox('Subkey: '+ACADVer, mbInformation, MB_OK);
SetLength(S, 1);
if S = 'R' Then
begin
(* find next subkey using a for loop and RegGetSubkeyNames (should start with ACAD-) *)
RegSubkey:= 'Software\\Autodesk\\AutoCAD\\' + ACADVer
MsgBox('RegSubkey: '+RegSubkey, mbInformation, MB_OK);
if RegGetSubkeyNames(HKEY_CURRENT_USER, RegSubkey, Names) then
begin
for I := 0 to GetArrayLength(Names)-1 do
S:= Names;
ACADLang:= S
MsgBox('Subkey: '+ACADLang, mbInformation, MB_OK);
SetLength(S, 4);
if S = 'ACAD' Then
begin
(* use these values to insert a key in Applications subkey of the registry *)
RegSubkey:= RegSubkey + '\\' + ACADLang + '\\Applications\\ACADOpsPost'
MsgBox('RegSubkey: '+RegSubkey, mbInformation, MB_OK);
RegWriteStringValue(HKEY_CURRENT_USER, RegSubkey, 'DESCRIPTION', 'Operations and Posting Window');
RegWriteStringValue(HKEY_CURRENT_USER, RegSubkey, 'LOADER', 'D:\Program Files (x86)\AutoCADOperationsPost\ACADOpsPost.dll');
RegWriteDWordValue(HKEY_CURRENT_USER, RegSubkey, 'LOADCTRLS', 2)
RegWriteDWordValue(HKEY_CURRENT_USER, RegSubkey, 'MANAGED', 1)

RegSubkey:= RegSubkey + '\\Commands'
RegWriteStringValue(HKEY_CURRENT_USER, 'Software\\Autodesk\\AutoCAD\\' + ACADVer + '\\' + ACADLang + '\\Applications\\ACADOpsPost\\Commands', 'LoadPost', 'LoadPost');
end;
end;

end else
begin
MsgBox('Couldn''t find correct registry placement', mbInformation, MB_OK);
Result := False
Abort;
end;

end else
begin
MsgBox('Couldn''t find correct registry placement', mbInformation, MB_OK);
Result := False
Abort;
end;
end;
{code} Edited by: vampirefromtheitcave2 on Apr 1, 2010 7:21 PM
0 Likes
Message 4 of 7

Anonymous
Not applicable
If it works on your development system, that
usually is because something exists there already
that doesn't exist on the target system.

For example, if the subkey that you write to
already exists on your development system,
then you will not get the error that occurs if
the key doesn't exist.

Try removing everthing that the installer does on
the system where it works (e.g., all of the keys
that it creates), and I'll bet it doesn't work there
either.

I've not written any Inno scripts in a while, and
don't remember if its necessary but don't you
need to create the subkey under "Applications"
before you can write values to it? I don't see
where you're doing that.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:[email protected]...
No. I was wondering if there are any known issues with Inno Setup that would
cause this. It runs perfectly on my machine (adds files to the program folder
and adds the registry keys), but fails on other machines, even with
administrative privileges. I will attach the file this time, but I don't know
that it will help because it works on my machine.

{code}
[Code]
var
Names: TArrayOfString;
ACADVer: String;
ACADLang: String;
RegSubkey: String;
I: Integer;
S: String;
function InitializeSetup(): Boolean;
begin
Result:= True
(* find correct subkey using a for loop and RegGetSubkeyNames (should start
with R) *)
if RegGetSubkeyNames(HKEY_CURRENT_USER, 'Software\\Autodesk\\AutoCAD', Names)
then
begin
MsgBox('Got Subkey Names', mbInformation, MB_OK);
for I := 0 to GetArrayLength(Names)-1 do
S:= Names;
ACADVer:= S
MsgBox('Subkey: '+ACADVer, mbInformation, MB_OK);
SetLength(S, 1);
if S = 'R' Then
begin
(* find next subkey using a for loop and RegGetSubkeyNames (should start
with ACAD-) *)
RegSubkey:= 'Software\\Autodesk\\AutoCAD\\' + ACADVer
MsgBox('RegSubkey: '+RegSubkey, mbInformation, MB_OK);
if RegGetSubkeyNames(HKEY_CURRENT_USER, RegSubkey, Names) then
begin
for I := 0 to GetArrayLength(Names)-1 do
S:= Names;
ACADLang:= S
MsgBox('Subkey: '+ACADLang, mbInformation, MB_OK);
SetLength(S, 4);
if S = 'ACAD' Then
begin
(* use these values to insert a key in Applications subkey of the
registry *)
RegSubkey:= RegSubkey + '\\' + ACADLang +
'\\Applications\\ACADOpsPost'
MsgBox('RegSubkey: '+RegSubkey, mbInformation, MB_OK);
RegWriteStringValue(HKEY_CURRENT_USER, RegSubkey, 'DESCRIPTION',
'Operations and Posting Window');
RegWriteStringValue(HKEY_CURRENT_USER, RegSubkey, 'LOADER',
'D:\Program Files (x86)\AutoCADOperationsPost\ACADOpsPost.dll');
RegWriteDWordValue(HKEY_CURRENT_USER, RegSubkey, 'LOADCTRLS', 2)
RegWriteDWordValue(HKEY_CURRENT_USER, RegSubkey, 'MANAGED', 1)

RegSubkey:= RegSubkey + '\\Commands'
RegWriteStringValue(HKEY_CURRENT_USER,
'Software\\Autodesk\\AutoCAD\\' + ACADVer + '\\' + ACADLang +
'\\Applications\\ACADOpsPost\\Commands', 'LoadPost', 'LoadPost');
end;
end;

end else
begin
MsgBox('Couldn''t find correct registry placement', mbInformation, MB_OK);
Result := False
Abort;
end;

end else
begin
MsgBox('Couldn''t find correct registry placement', mbInformation, MB_OK);
Result := False
Abort;
end;
end;
{code}

Edited by: vampirefromtheitcave2 on Apr 1, 2010 7:21 PM
0 Likes
Message 5 of 7

Anonymous
Not applicable
Hi,

You best option is to post this to the Inno Setup 'Code' newsgroup.
Tell them which version of Inno Setup you are using.


Regards,


Laurie Comerford

vampirefromtheitcave2 wrote:
> No. I was wondering if there are any known issues with Inno Setup that would cause this. It runs perfectly on my machine (adds files to the program folder and adds the registry keys), but fails on other machines, even with administrative privileges. I will attach the file this time, but I don't know that it will help because it works on my machine.
>
> {code}
> [Code]
> var
> Names: TArrayOfString;
> ACADVer: String;
> ACADLang: String;
> RegSubkey: String;
> I: Integer;
> S: String;
> function InitializeSetup(): Boolean;
> begin
> Result:= True
> (* find correct subkey using a for loop and RegGetSubkeyNames (should start with R) *)
> if RegGetSubkeyNames(HKEY_CURRENT_USER, 'Software\\Autodesk\\AutoCAD', Names) then
> begin
> MsgBox('Got Subkey Names', mbInformation, MB_OK);
> for I := 0 to GetArrayLength(Names)-1 do
> S:= Names;
> ACADVer:= S
> MsgBox('Subkey: '+ACADVer, mbInformation, MB_OK);
> SetLength(S, 1);
> if S = 'R' Then
> begin
> (* find next subkey using a for loop and RegGetSubkeyNames (should start with ACAD-) *)
> RegSubkey:= 'Software\\Autodesk\\AutoCAD\\' + ACADVer
> MsgBox('RegSubkey: '+RegSubkey, mbInformation, MB_OK);
> if RegGetSubkeyNames(HKEY_CURRENT_USER, RegSubkey, Names) then
> begin
> for I := 0 to GetArrayLength(Names)-1 do
> S:= Names;
> ACADLang:= S
> MsgBox('Subkey: '+ACADLang, mbInformation, MB_OK);
> SetLength(S, 4);
> if S = 'ACAD' Then
> begin
> (* use these values to insert a key in Applications subkey of the registry *)
> RegSubkey:= RegSubkey + '\\' + ACADLang + '\\Applications\\ACADOpsPost'
> MsgBox('RegSubkey: '+RegSubkey, mbInformation, MB_OK);
> RegWriteStringValue(HKEY_CURRENT_USER, RegSubkey, 'DESCRIPTION', 'Operations and Posting Window');
> RegWriteStringValue(HKEY_CURRENT_USER, RegSubkey, 'LOADER', 'D:\Program Files (x86)\AutoCADOperationsPost\ACADOpsPost.dll');
> RegWriteDWordValue(HKEY_CURRENT_USER, RegSubkey, 'LOADCTRLS', 2)
> RegWriteDWordValue(HKEY_CURRENT_USER, RegSubkey, 'MANAGED', 1)
>
> RegSubkey:= RegSubkey + '\\Commands'
> RegWriteStringValue(HKEY_CURRENT_USER, 'Software\\Autodesk\\AutoCAD\\' + ACADVer + '\\' + ACADLang + '\\Applications\\ACADOpsPost\\Commands', 'LoadPost', 'LoadPost');
> end;
> end;
>
> end else
> begin
> MsgBox('Couldn''t find correct registry placement', mbInformation, MB_OK);
> Result := False
> Abort;
> end;
>
> end else
> begin
> MsgBox('Couldn''t find correct registry placement', mbInformation, MB_OK);
> Result := False
> Abort;
> end;
> end;
> {code}
>
> Edited by: vampirefromtheitcave2 on Apr 1, 2010 7:21 PM
>
0 Likes
Message 6 of 7

Anonymous
Not applicable
There is no function for creating an empty key in Inno Setup, at least not that I have been able to find after reading the registry functions a few times over. I just tested an idea I had on one of the computers that it didn't work on that might help you. I installed Inno Setup, transferred the setup file in raw and compiled form, and ran it again. The compiled form didn't work at first, but then I commented out the lines that didn't work for that computer in the raw form (source files) and it ran (I was testing the registry part, which shouldn't be affected by the [Files] section, so I'm pretty sure it had nothing to do with commenting out those lines.). Then I tried to run the fully compiled form that I transferred and that also worked. I don't think it has to do with the entry actually not being there, because that section of the registry exists in every computer I have tried to install the program on. I have triple checked.
0 Likes
Message 7 of 7

Anonymous
Not applicable
The new subkey under Applications\ that you're
writing to already exists?

How can that be?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:[email protected]...
There is no function for creating an empty key in Inno Setup, at least not that
I have been able to find after reading the registry functions a few times over.
I just tested an idea I had on one of the computers that it didn't work on that
might help you. I installed Inno Setup, transferred the setup file in raw and
compiled form, and ran it again. The compiled form didn't work at first, but
then I commented out the lines that didn't work for that computer in the raw
form (source files) and it ran (I was testing the registry part, which shouldn't
be affected by the [Files] section, so I'm pretty sure it had nothing to do with
commenting out those lines.). Then I tried to run the fully compiled form that
I transferred and that also worked. I don't think it has to do with the entry
actually not being there, because that section of the registry exists in every
computer I have tried to install the program on. I have triple checked.
0 Likes