Running a commandline utility
Running a commandline utility
I am trying to run a commandline utility for a very specific task.
I added the .exe as a support file and tried to run it with "run program as" by using this path "$SUPPORTDIR$\WmiSecurity.exe" and passing the correct parameters in. Nothing happens.
Guess there's something wrong but I do not know what it could be, so I started to investigate the issue.
1) I tried to log the installation, I only got a 1.6 mb file FULL of useless internal info, there's not even a mention of the program being executed! There's no mention of the support file being copied to the support folder, too.
2) I added some logging by using "write to text file" with $LOGGED$. The log file became an unreadable mess. No luck here, I found a topic that tells me I should use a different file to log my own info. Done it, the parameters look correct in my log.
3) So, thinking that I could see the error in action, I changed the package to run a batch file (adding a "pause" command), created using "write to text file" actions. The file isn't created at all. Maybe the help is wrong and the action only appends to an existing file? No, I also tried to distribute an empty batch file, but no luck again. Maybe it's a short path issue? Nope, I also tried with the "convert path" action.
I am probably doing something horribly wrong, I really hope so, but the main problem here is that the debug is a real pain, I have no clue from the IDE and neither from the log file.
Before you ask, I am attaching a sample project. And also, before you tell me so, I DO NOT want to upgrade to NX to solve this.
I will probably seem rude here, but I am literally filling my setup with hacks and I am a bit tired of this.
Regards
I added the .exe as a support file and tried to run it with "run program as" by using this path "$SUPPORTDIR$\WmiSecurity.exe" and passing the correct parameters in. Nothing happens.
Guess there's something wrong but I do not know what it could be, so I started to investigate the issue.
1) I tried to log the installation, I only got a 1.6 mb file FULL of useless internal info, there's not even a mention of the program being executed! There's no mention of the support file being copied to the support folder, too.
2) I added some logging by using "write to text file" with $LOGGED$. The log file became an unreadable mess. No luck here, I found a topic that tells me I should use a different file to log my own info. Done it, the parameters look correct in my log.
3) So, thinking that I could see the error in action, I changed the package to run a batch file (adding a "pause" command), created using "write to text file" actions. The file isn't created at all. Maybe the help is wrong and the action only appends to an existing file? No, I also tried to distribute an empty batch file, but no luck again. Maybe it's a short path issue? Nope, I also tried with the "convert path" action.
I am probably doing something horribly wrong, I really hope so, but the main problem here is that the debug is a real pain, I have no clue from the IDE and neither from the log file.
Before you ask, I am attaching a sample project. And also, before you tell me so, I DO NOT want to upgrade to NX to solve this.
I will probably seem rude here, but I am literally filling my setup with hacks and I am a bit tired of this.
Regards
- Attachments
-
- IA_Test.zip
- (365.78 KiB) Downloaded 551 times
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Running a commandline utility
Dear User,
no one of us will force you to upgrade to InstallaWare NX, but ... I don't understand what you mean with:
Regards.
no one of us will force you to upgrade to InstallaWare NX, but ... I don't understand what you mean with:
Let me verify your project and I will be back as soon as possible.I will probably seem rude here, but I am literally filling my setup with hacks and I am a bit tired of this.
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: Running a commandline utility
Hi FrancescoT, thanks for your quick reply.
My reference to NX is related to a previous answer (yours, if I remember correctly) on a different problem. Basically, I was told to test the problem on NX, while I only have licenses for the 2012.
The hacks I am referring to are several workarounds and forum suggestions I had to implement in my setup to make several things work.
Regards
My reference to NX is related to a previous answer (yours, if I remember correctly) on a different problem. Basically, I was told to test the problem on NX, while I only have licenses for the 2012.
The hacks I am referring to are several workarounds and forum suggestions I had to implement in my setup to make several things work.
Regards
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Running a commandline utility
Dear User,
Probably I was misinterpreted ... actually I don't remember the specific question... but I suppose I only suggested to verify with IA NX.
By the way, let me verify your project ... and I will tell you.
Regards
Probably I was misinterpreted ... actually I don't remember the specific question... but I suppose I only suggested to verify with IA NX.
By the way, let me verify your project ... and I will tell you.
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: Running a commandline utility
I ran your project and the batch-file was not generated...
Re: Running a commandline utility
That's the point.
The code looks correct (well, to my eyes at least
) but the result does not.
I hope they are able to discover the problem in my code, as I am not...
The code looks correct (well, to my eyes at least
I hope they are able to discover the problem in my code, as I am not...
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Running a commandline utility
Dear lbertoldi,
Please use the attached project and verify if solves your issue.
I have tested it and seems to work fine now.
By the way, don't use quotes with Write To File and Run Program commands ... because IA already handles the parameter in the correct way.
Hope this helps you.
Regards
Please use the attached project and verify if solves your issue.
I have tested it and seems to work fine now.
By the way, don't use quotes with Write To File and Run Program commands ... because IA already handles the parameter in the correct way.
Hope this helps you.
Regards
- Attachments
-
- lbertoldi.zip
- (351.66 KiB) Downloaded 538 times
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: Running a commandline utility
Thanks, Francesco, it worked!!!
I could have sworn I tried without the quotes, but apparently I didn't. My bad.
My point still stands, though: why does the logged installation not log anything useful in the log file? Each command has a set of parameters, so it should be easy for you to log the command itself, the parameters and the result along with any error. I am not even able to understand if a specific command has been run or not.
So, if IA logged something like "file not found ""c:\...\cfgwmi.bat""" I could have guessed that the quotes were not needed...
However, thanks again for your support!
I could have sworn I tried without the quotes, but apparently I didn't. My bad.
My point still stands, though: why does the logged installation not log anything useful in the log file? Each command has a set of parameters, so it should be easy for you to log the command itself, the parameters and the result along with any error. I am not even able to understand if a specific command has been run or not.
So, if IA logged something like "file not found ""c:\...\cfgwmi.bat""" I could have guessed that the quotes were not needed...
However, thanks again for your support!
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Running a commandline utility
Happy that you solved.
The log reports mainly the log queue generated by the MSI engine and the "Write to Text File" is a direct execute command, executed outside the MSI engine.
Regards
The log reports mainly the log queue generated by the MSI engine and the "Write to Text File" is a direct execute command, executed outside the MSI engine.
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: Running a commandline utility
lbertoldi,
I use the Plugin Camelot, that includes a function "WriteToLogFile". With it your can log you own script. This should help you!
I use the Plugin Camelot, that includes a function "WriteToLogFile". With it your can log you own script. This should help you!
Last edited by alibaba on Thu Oct 11, 2012 7:05 am, edited 1 time in total.
Re: Running a commandline utility
Thanks alibaba, I will give that a try!

