Re: Disable files with dhtml/vbs?
From: KM (konstmor_at_nospam_yahoo.com)
Date: 06/27/04
- Next message: Aqua: "I don't success to install windows embedded on Windows XP SP2 !!!"
- Previous message: KM: "Re: DUA will not install MSI files"
- In reply to: Alexander Suhovey: "Re: Disable files with dhtml/vbs?"
- Next in thread: Alexander Suhovey: "Re: Disable files with dhtml/vbs?"
- Reply: Alexander Suhovey: "Re: Disable files with dhtml/vbs?"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 27 Jun 2004 00:08:12 -0700
Alexander,
Yes, it always sounds simple when you have done that :-)
A couple of hints for you (so that you don't spend much time on that).
Within the script use cmiThis object to refer to the instance in the context
of which you work.
When you enumerate your component (instance) resources, search for ones with
the property ResourceTypeVSGUID="{E66B49F6-4A35-4246-87E8-5C1A468315B5}".
Those will be the file resources.
A file name will be the value of the extended property "DstName" of the
resource (Properties collection).
So, the VB script that disables a particular file resource of the current
component instance may look like:
For Each oResource In cmiThis.Resources
If ("{E66B49F6-4A35-4246-87E8-5C1A468315B5}" =
oResource.ResourceTypeVSGUID) Then
If oResource.Properties.Exists("DstName") And
oResource.Properties("DstName").Value="<you file name here>" Then
oResource.Properties.Disabled = True
Exit For
End If
End If
Next
(I haven't tested the above you you will need to use/modify it on your own
risk).
For other resources (registry key, reg value, etc.) you will just need to
use different predefined GUIDs (not important for you now but for any future
use).
Regards,
Konstantin
> So if it is that simple the only thing left is to find correct syntax.
Hack,
> you say? I like how it sounds :)
> Thank you.
>
>
> "KM" <konstmor@nospam_yahoo.com> wrote in message
> news:u%23Wou9wWEHA.1368@TK2MSFTNGP10.phx.gbl...
> > Alexander,
> >
> > Only resources I know is google (and my components on www.xpefiles.com
> :-)).
> > Basically, CMI is undocumented and will unlikely be documented for XPe.
> > If you want to deal with CMI (I agree - very handy stuff), you will have
> to
> > hack it.
> >
> > From what you wrote it is doable. You will have to work with Resources
> > collections of IInstance interface. You will just need to disable/enable
> > particular component (instance) resources like file entries you
mentioned.
> > Similar is implemented in the File filter search of the
DependencyExplorer
> > component from www.xpefiles.com.
> >
> > KM
> >
> > > Uh... I guess I'm asking too much. Well then.
> > >
> > > Is there *any* CMI reference available?..
> > >
> > > "Alexander Suhovey" <asuhovey@mtu-net.ru> wrote in message
> > > news:OVJU88qWEHA.2576@TK2MSFTNGP10.phx.gbl...
> > > > Hi,
> > > > Currently i'm trying to look into all this handy dhtml/vbs/cmi stuff
> to
> > > make
> > > > custom settings pages for my components. In particular, I have one
> > simple
> > > > component that sets pre-login wallpaper to my company's logo as well
> as
> > > > default background color. This component includes two bmps - one for
> > > > portrait screen alignment, one for landscape. I already have figured
> > (with
> > > > help of this NG of course) how to create a setting page wich allow
> > > developer
> > > > to choose correct wallpaper. Then script sets correct wallpaper in
> > > registry
> > > > according to dhtml settings tab. What I also want to achieve is that
> > only
> > > > one bmp is copied to image. So I guess I should change component
> script
> > so
> > > > it disables unneeded bmp in component properties so it will not be
> > copied
> > > to
> > > > image.
> > > > Somebody could say "Hey, you can simply create two components
instead
> of
> > > > one". Yeah I know, I'm trying to do this rather for educational
> > purposes.
> > > >
> > > > Can it be done this way? If yes, could somebody please provide some
> vbs
> > > > sample?
> > > >
> > > > Thanks in advance,
> > > > Al.
> > > >
> > > >
> > >
> > >
> > >
> >
> >
>
>
>
>
- Next message: Aqua: "I don't success to install windows embedded on Windows XP SP2 !!!"
- Previous message: KM: "Re: DUA will not install MSI files"
- In reply to: Alexander Suhovey: "Re: Disable files with dhtml/vbs?"
- Next in thread: Alexander Suhovey: "Re: Disable files with dhtml/vbs?"
- Reply: Alexander Suhovey: "Re: Disable files with dhtml/vbs?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|