The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 opk files
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

alex_eagle

Austria
36 Posts

Posted - 11/13/2002 :  08:06:55 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I share opk-files with my colleagues. Now I updated my script and want to send the opk-file again.
How can I overwrite the original INI-file so that the installation
will work without deleting done by the user ??

Thank you
Alex


Mike Buess

USA
3037 Posts

Posted - 11/13/2002 :  08:30:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Alex,

In Origin 6.1 the contents of the OPK will overwrite older files automatically. In Origin 7 the user is asked first. Advise your colleagues to choose "Yes for all". Of course you should try it out yourself first.

...You can force the files to be overwritten without prompting in Origin 7 by adding this command to the [OnBeforeSetup] section of OPKSetup.ogs:

opack.autoreplace=1;

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 11/13/2002 08:39:01 AM
Go to Top of Page

alex_eagle

Austria
36 Posts

Posted - 11/13/2002 :  11:46:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,

thanx for your quick answer.
However, it seems the opk-file doesnt overwrite the original files.
I get the error message: "This ini-file cannot be created, because it is used by another group"
I send you the OPKsetup.ogs as I found it in my Origin-directory.

if (run.section(GDOES.ogs, OnBeforeSetup) == 1) 
{
opack.undo();
return;
}
else
{

if (system.toolbar.createcategory("GDOES.INI") == 0)
{
system.toolbar.create(GDOES);
%A=$General.UserDefinedGroupAdded;
%B=$General.UserDefinedGroup;
type.msgBox(GDOES %A, %B);
}
}
run.section(GDOES.ogs, OnAfterSetup);


Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 11/14/2002 :  12:25:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Alex,

The error message occurs because you're trying to create a button category (GDOES) that already exists and I suspect that the files are being overwritten anyway. In any case you can avoid the error message by testing for the existance of the GDOES toolbar before trying to create the category. Note: system.toolbar.exists() returns the wrong value in Origin 6.1 (the wording of your error message suggests that's what you are using) and the ternary expression in the new if() statement compensates for that.
if (run.section(GDOES.ogs, OnBeforeSetup) == 1) 
{
opack.undo();
return;
}
else
{
if (system.toolbar.exists(GDOES) == (int(@V)==7)?0:1)
{
if (system.toolbar.createcategory("GDOES.INI") == 0)
{
system.toolbar.create(GDOES);
%A=$General.UserDefinedGroupAdded;
%B=$General.UserDefinedGroup;
type.msgBox(GDOES %A, %B);
}
}
}
run.section(GDOES.ogs, OnAfterSetup);
This assumes that you've only changed the scripts and not the toolbar. It's a little more complicated to make toolbar changes by script, so please post back if you need to do that.

Mike Buess
Origin WebRing Member
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000