Hi,
We have an installer where we need to create the event source at install time. This is the only time we can guarentee administrator rights and I do this with standard deployment projects within Visual Studio with ease by overriding the Install method in the installer class.
Can you advise the best way to do this in InstallAware? Is creating an executable and including in the "Run Program" your only solution?
kind regards
Event Source
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Event Source
Dear User,
I'm not quite sure if I follow your question.
What do you exacly mean with, "We have an installer where we need to create the event source at install time"?
Regards
I'm not quite sure if I follow your question.
What do you exacly mean with, "We have an installer where we need to create the event source at install time"?
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Event Source
Dear Francesco,
I have a product which needs to be installed both on Windows 7 and XP machines.
When an error occurs, I need to be able to write to the event viewer from my application. To do this I need an event source. The only time we have admin rights within Windows 7 is during the install process. This is where we need to create that event source.
How is this best done using InstallAware? Within .Net it would be...
System.Diagnostics.EventLog.CreateEventSource(source,logname)
Regards
I have a product which needs to be installed both on Windows 7 and XP machines.
When an error occurs, I need to be able to write to the event viewer from my application. To do this I need an event source. The only time we have admin rights within Windows 7 is during the install process. This is where we need to create that event source.
How is this best done using InstallAware? Within .Net it would be...
System.Diagnostics.EventLog.CreateEventSource(source,logname)
Regards
Re: Event Source
Hello Biscuits,
I understand what you want to do but I don't recall anything in IA that does it for you. In the MSIcode window look at the commands and plugins on the right of your screen. Scroll through them and if there is something you should be able to do it. If there isn't, you might want to create a dotnet app that writes to the event viewer for you. Perhaps create a console application and pass in arguments that identify the event source you want to write to and the message you want to write.
Then include your dotnet app as a support file which is only available at installation time and isn't installed. You can then run the command (there's a run command in IA) and let it do the work for you.
If there's a simpler way, Francesco will advise you.
I understand what you want to do but I don't recall anything in IA that does it for you. In the MSIcode window look at the commands and plugins on the right of your screen. Scroll through them and if there is something you should be able to do it. If there isn't, you might want to create a dotnet app that writes to the event viewer for you. Perhaps create a console application and pass in arguments that identify the event source you want to write to and the message you want to write.
Then include your dotnet app as a support file which is only available at installation time and isn't installed. You can then run the command (there's a run command in IA) and let it do the work for you.
If there's a simpler way, Francesco will advise you.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
InstallAware MVP
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Event Source
.... I can only confirm what Bokkie has very well explained.
Regards
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Event Source
Thank you for the responses. We managed to do the following with the "Run Program" function in IA which seems to work, although not tested in all evironments yet...
Run Program : eventcreate
Hide Program Window : True
Command Line Parameters : /ID 1 /L APPLICATION /T INFORMATION /SO EventSourceName /D "Installed"
Wait For Program to Finish : True
This will log a new event, of type information when installing. As it is in admin mode at this time it creates the event source at the same time. The program eventcreate is a Windows one existing in both XP and Win7 therefore there is no need for a custom console application.
Run Program : eventcreate
Hide Program Window : True
Command Line Parameters : /ID 1 /L APPLICATION /T INFORMATION /SO EventSourceName /D "Installed"
Wait For Program to Finish : True
This will log a new event, of type information when installing. As it is in admin mode at this time it creates the event source at the same time. The program eventcreate is a Windows one existing in both XP and Win7 therefore there is no need for a custom console application.
Re: Event Source
Thanks a lot biscuits. I didn't know about eventcreate but I'm pleased to read that it and the run command statement helped you achieve your objective. 
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
InstallAware MVP
-
Sheri_Steeves
- Posts: 124
- Joined: Mon Oct 22, 2012 2:14 pm
Re: Event Source
Hello,
The way I've done this in the past is to extract the event source registry keys from my development box and add them as part of the install program by importing the .reg file.
The way I've done this in the past is to extract the event source registry keys from my development box and add them as part of the install program by importing the .reg file.
SheriWindows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Application\Your Application Here]
"EventMessageFile"=hex(2):43,00,3a,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77, 00,73,00,5c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,2e,00, 4e,00,45,00,54,00,5c,00,46,00,72,00,61,00,6d,00,65,00,77,00,6f,00,72,00,6b, 00,5c,00,76,00,34,00,2e,00,30,00,2e,00,33,00,30,00,33,00,31,00,39,00,5c,00, 45,00,76,00,65,00,6e,00,74,00,4c,00,6f,00,67,00,4d,00,65,00,73,00,73,00,61, 00,67,00,65,00,73,00,2e,00,64,00,6c,00,6c,00,00,00

