Page 1 of 3 123>
Topic Options
#71013 - 2002-10-22 09:31 AM UpdateKiXForms() - comments
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I quess the name could be replaceKiXForms()

or, it could check the current version and if same, does not replace it...

[ 22. October 2002, 10:23: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#71014 - 2002-10-22 10:09 AM Re: UpdateKiXForms() - comments
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Yep, you're right. Thanks Lonkero, I'll work on that tomorrow.
Top
#71015 - 2002-10-22 02:32 PM Re: UpdateKiXForms() - comments
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
doc, saw your reply on the udf.
at least, this part:
code:
$FormFileVer=GETFILEVERSION("%windir%\system32\kixforms.dll", "Fileversion")
Shell '%compspec% "%windir%\system32\regsvr32.exe %windir%\system32\kixforms.dll /u" >nul 2>nul'
IF Not Exist("C:\KIXFORMS\$FormFileVer")
MD ("C:\KIXFORMS\$FormFileVer")
EndIf
COPY "%windir%\system32\kixforms.dll" "C:\KIXFORMS\$FormFileVer\"

should be:
code:
$FormFileVer=GETFILEVERSION($destination+"\kixforms.dll", "Fileversion")
Shell '%compspec% /c "$destination'+'\regsvr32.exe $destination'+'\kixforms.dll /u" >nul 2>nul'
IF Not Exist("C:\KIXFORMS\$FormFileVer")
MD ("C:\KIXFORMS\$FormFileVer")
EndIf
COPY $destination+"\kixforms.dll" "C:\KIXFORMS\$FormFileVer\"

eh... something similar.
also, instead of shelling to dos, you could use:
code:
shell $destination+'\regsvr32.exe $destination'+'\kixforms.dll /u /s'

also, assuming that kixforms is currently at system folder... nah, do this:
code:
$id=readvalue("HKEY_CLASSES_ROOT\Kixtart.Static\CLSID","")
$location=readvalue("HKEY_CLASSES_ROOT\CLSID\"+$id+"\InprocServer32","")
$currentversion=""+getfileversion($location,"FileVersion")

[Cool]
_________________________
!

download KiXnet

Top
#71016 - 2002-10-22 07:13 PM Re: UpdateKiXForms() - comments
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Lonkero,

I'll look at making some newer code... as for the last suggestion about CLSID - that's a no go as it would only work for those of you that "install" kix on the computer.

I don't install KiX or modify the registry on any systems.

Thanks for the /s switch. I forgot to look for switches. Hey - it was late [Razz]

Top
#71017 - 2002-10-22 07:19 PM Re: UpdateKiXForms() - comments
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Jooel,
I'm afrad you lost me with this "HKEY_CLASSES_ROOT\Kixtart.Static\CLSID" thingy. I have never known KiX to register itself. [Confused]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#71018 - 2002-10-22 07:29 PM Re: UpdateKiXForms() - comments
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
boys???
doc: no install!

les: yes, when you run regsvr32, you register it.
if you read the name of the app: reg svr 32
32 bit registering...

registering a dll is "registered" in registry.
at least, for bbChecker install, I've always used that, and mostlikely am going to use it.

why? older kixforms releases do not have version query inbuild, thus reading it from registry is more solid way to get the info.

{edit}
once again, had to many typos...

[ 22. October 2002, 19:53: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#71019 - 2002-10-22 07:33 PM Re: UpdateKiXForms() - comments
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Still confused [Confused]

What DLL are you talking about only Wintendos need KiX DLLs.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#71020 - 2002-10-22 07:46 PM Re: UpdateKiXForms() - comments
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
oh, you actually are lost!
I thought that you just missed the bus but you are actually in sweden [Big Grin]

if you check the topic, we are not talking kix but KiXforms. [Razz]

{edit}
re-read the whole topic and found one my bad.
in one reply (fixed now) me was talking about kix when ment kixforms.
so, maybe you just missed the bus, not airplain [Wink]

[ 22. October 2002, 19:54: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#71021 - 2002-10-22 10:20 PM Re: UpdateKiXForms() - comments
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Okay Lonkero...

Again, you're probably correct about KiXForms being in the Registry. I too thought you were talking about KiXtart and not KiXForms....

Probably no time today, have to rebuild a server.

Will update as soon as I can.

Top
#71022 - 2002-10-24 03:10 AM Re: UpdateKiXForms() - comments
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Okay, I updated the UDF code.

Let me know if you have any problems with it.

http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000285

Top
#71023 - 2002-10-24 03:24 AM Re: UpdateKiXForms() - comments
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
tested? [Razz]
this should not work on any platform:
code:
If Not Exist ($Destination+kixforms.dll)

[Big Grin]

also:
code:
Copy "$Location" "C:\KIXFORMS\$CurrentVersion\"	
If @Error=0
Del $Location
COPY $Source $Destination
If @Error=0
Shell $destination+'\regsvr32.exe $destination'+'\kixforms.dll /s'
EndIf
Else
Shell $destination+'\regsvr32.exe $destination'+'\kixforms.dll /s'
EndIf

copies the new dll to systemdir only if backing of old succesfull? sure you wanted it that way?

and then ofcourse, minor me want (and logic error):
code:
IF NOT INGROUP("\\@WKSTA\Administrators") <>0
Return ;user is not an admin so can't update KiXForms... return to calling script.
EndIf

could be:
code:
IF NOT INGROUP("\\@WKSTA\Administrators")
Exit 5
EndIf

_________________________
!

download KiXnet

Top
#71024 - 2002-10-24 03:40 AM Re: UpdateKiXForms() - comments
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Well,

Typically I never use the QUIT command as I normally call from a MAIN script and a QUIT command would quit the entire script and not return back to the calling script.

MCA actually was the one that convinced me to use <>0 rather then without. Yes, the code will work either way, but this is not a game of KiXGolf. When MCA gets back I'll let him explain why he feels it is better to use it this way.

As far as this:
If Not Exist ($Destination+kixforms.dll)

Not working on any platform... don't know what to tell you. It may NOT be good programming code or sytle, but it works on all my systems.

And I guess I have a different mind set on the logic of why/when I would or would not want to regsrv32 the dll.

Not that I could not be persuaded, but then again. I'm sure that getting EVERYONE to agree on the exact way they want it, would be rather difficult to achieve.

As far as coding style, I'm up for improvement ideas, as I have already taken some of your ideas Lonkero and incorporated them into the code.

Top
#71025 - 2002-10-24 03:48 AM Re: UpdateKiXForms() - comments
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
eh?

exit is not same as quit.
I have always got the expression that if used in function, it returns as error the exit's result?
not quitting the whole script, only the function.

on the behalf of <>, you already use NOT there.
it's binary operand which does turn its right side to other.

meaning:
NOT 1 - results zero (actually false)
NOT 1 <> 0 - results false
NOT (1 <> 0) - results false

so, it is not issue of golfing, just logic.
or do you say:
"when I drank that milk. ,if"

if it works, ok. but it's not "correct" syntax anyway.
again, it's matter of opinion.

also, having string in there without quotes?
ok, if it works but wonder why it does as it definitely should not.

[ 24. October 2002, 03:52: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#71026 - 2002-10-24 04:15 AM Re: UpdateKiXForms() - comments
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Okay,

Per your suggestions Lonkero I have modified the code again.

Hope this looks a little better. Af far as the backup and regsrv32. I don't want to waste my time regging if the copy failed. This is not bullet-proof, but should hopefully work for most systems.

Top
#71027 - 2002-10-24 05:09 AM Re: UpdateKiXForms() - comments
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
So does this look better now Lonkero?
Top
#71028 - 2002-10-24 05:19 AM Re: UpdateKiXForms() - comments
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
better? sure.
not perfect but who can ask for that [Wink]

that's why didn't reply as saw it's quite nice now.

one thing have though, your picture in profile does not show up... [Razz]
_________________________
!

download KiXnet

Top
#71029 - 2002-10-24 05:23 AM Re: UpdateKiXForms() - comments
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Actually, I think the textbook way to do:
If Not Exist ($Destination+kixforms.dll)

is:
If Not Exist ($Destination+"kixforms.dll")

The new way frowns [Frown] on vars in strings so thinking along those lines...
Shell $destination+'\regsvr32.exe $destination'+'\kixforms.dll /s'

also should be:
Shell $destination+'\regsvr32.exe '+$destination+'\kixforms.dll /s'

but my preferred way is:
$ShellCMD=$destination+'\regsvr32.exe '+$destination+'\kixforms.dll /s'
Shell $ShellCMD

Hope you don't mind a bit of critiquing.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#71030 - 2002-10-24 06:01 AM Re: UpdateKiXForms() - comments
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
les, I'm on the same road with you.

except, your preferred way (I think it's also jens way...) is looking "ugly" and unneeded.

still, like doc said somewhere already, can't please everyone [Wink]
_________________________
!

download KiXnet

Top
#71031 - 2002-10-24 06:55 AM Re: UpdateKiXForms() - comments
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Okay... I tried to please both of you.

Yes, Lonkero is correct, not needed, but I took ideas and suggestions from both of you.

I implemented stuff from both of you in this new updated version.

http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000285#000000

[ 24. October 2002, 06:56: Message edited by: NTDOC ]

Top
#71032 - 2002-10-24 07:09 AM Re: UpdateKiXForms() - comments
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I quess, I can remove those shellcmd lines by myself and thus reduce execution time.

what comes to diff from 1.0 to this, it's like night and day.
looking really nice now...

still 2 args could be optional there...
1 - source
2 - forced destination
_________________________
!

download KiXnet

Top
Page 1 of 3 123>


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 657 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.082 seconds in which 0.034 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org