Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How to Add a Standard Action


7 replies to this topic

ngo

ngo
  • Full Members
  • 10 posts

Posted 19 January 2010 - 21:57

Hi there,

I need to call WriteEnvironmentStrings during install - there are a lot of info on adding Custom Action, but none that I could find on adding a Standard Action.

Can someone please help?

ngo

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 20 January 2010 - 10:35

If it's not already there, you can simply insert it in the InstallExecute sequence.

ngo

ngo
  • Full Members
  • 10 posts

Posted 20 January 2010 - 21:42

Just to try this out, I used Orca and edited the WriteEnvironmentStrings under the InstallExecuteSequence so that the 'Condition' becomes MYROOT="C:\TEMP", I then ran the install - and it ran successfully without any reported error. But when I checked the Environment Variables, there is no MYROOT entry at all.

What I want to do is to add the following Environment Variable during install.

Variable Value
MYROOT C:\TEMP

Please help.

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 21 January 2010 - 15:34

You have misunderstood. By populating the Condition cell, you have set a condition of the CA's execution such that it will only run when MYROOT is equal to 'C:\TEMP'. You'd be better off using the Environment table if the data isn't required by the install. If it is, why not just create and set a property and use that?
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

ngo

ngo
  • Full Members
  • 10 posts

Posted 26 January 2010 - 19:24

Thanks VBScab,

I see what you're saying and my test really look silly. So, I set the WriteEnvironmentStrings to a condition that's always true and then tried adding the variable to the Environment Table, but got lost on the Environment and Component_ fileds, I just don't know what to enter for these required fields.

Anyway, what I really want to do is to add to the Windows Installer project so that during install, it would automatically do the following:
1. Create an Environment Variable MYROOT and set it to C:\TEMP;
2. Append TARGETDIR to PATH (like PATH=%PATH%;TARGETDIR in DOS)

And also have these two items undone during uninstall. Any ideas?

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 27 January 2010 - 11:01

All the information you need is in the MSDN article I linked to.

Environment
Just a "tag", if you like. Something to hang your hat on

Name
MYROOT

Value
C:\TEMP

Component_
The value that you have in the first column for the new component in the Component table - you need to create a component for this exercise and you'll also need to add the component to the FeatureComponent table. This table tells the engine which components get installed by which feature.

As you have found out, using Orca as a packaging tool, especially for newcomers, is painful beyond endurance. Have your employer spring for a proper packaging tool. The main players are Symantec/Altiris/Wise (their product managers seem uncertain how to style themselves after all the acquisitions...) with the Wise family and Acresso (sp?) with the InstallShield family. None of these is cheap (their accountants seem to think we're still in the 80s when no software could be bought for less than hundreds of dollars/pounds/Euros/whatever). Personally, having been a committed Wise user for many years, I would suggest InstallShield as the better route. The UI stinks but the product at least attempts to keep up with technology. Wise's track record is woeful in this regard: the latest v8 release is a con, in my view, and ought to have been released as v7.1 SP3.
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

ngo

ngo
  • Full Members
  • 10 posts

Posted 27 January 2010 - 14:53

Thanks again VBScab,

Again, my end goal is to integrate adding/removing environment variables into the WinInstaller project so that we don't have to manually do so after building the msi.

I know Orca is not the answer, and I use it only as a learning tool for exploring the msi under the hood. The info you gave for various install tools is very helpful, but unfortunately it would be hard to campaign for any of these installation software with my company. I'd rather spend my efforts developing one using existing technology.

Right now I'm exploring with VBScript CA to get this done and it looks promising. Thanks again for your help.

Regards,
ngo

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 28 January 2010 - 00:19

QUOTE (ngo @ 2010-01-27 14:53)
Thanks again VBScab,

Again, my end goal is to integrate adding/removing environment variables into the WinInstaller project so that we don't have to manually do so after building the msi.

I know Orca is not the answer, and I use it only as a learning tool for exploring the msi under the hood. The info you gave for various install tools is very helpful, but unfortunately it would be hard to campaign for any of these installation software with my company. I'd rather spend my efforts developing one using existing technology.

Right now I'm exploring with VBScript CA to get this done and it looks promising. Thanks again for your help.

Regards,
ngo

I used WinInstall a few years ago. I seem to recall that it had an interface option to add/change environment variables...

Anyway, Windows Installer is eminently scriptable. Indeed, I have a plethora of tools for my own use. However, if your intention is to build an authoring tool, you have a MAJOR project ahead of you. A download of one of the trial editions of the packages I mentioned will demonstrate that!

Good luck! smile.gif
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.