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