This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Custom Action: Launch Application Rundll32 printui
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 18, 2014
07:52 AM
Custom Action: Launch Application Rundll32 printui
Hi,
I'm having trouble getting setting up a custom install script in a Basic MSI project, I want to be able to run the following cmd line command in installscript;
I'm able to get make this work from the command line however whenever I try my LaunchApplication function it fails, I'm currently putting this as my LaunchApplication function;
When compiling I get printui: undefined identifier.
Am I barking up the wrong tree and is it even possible as a custom install script action?
I can make it work as a custom action -> New EXE - Stored in a binary table, however I have lots of these I wish to add so would like to do it in script.
Any help would be much appreciated.
Thanks in advance.
I'm having trouble getting setting up a custom install script in a Basic MSI project, I want to be able to run the following cmd line command in installscript;
C:\Windows\SysWOW64\rundll32 printui.dll,PrintUIEntry /if /b "Printer Name" /f "c:\\windows\inf\oem12.inf" /r "Lpt1:" /m "Printer Name" /z /u;
I'm able to get make this work from the command line however whenever I try my LaunchApplication function it fails, I'm currently putting this as my LaunchApplication function;
LaunchApplication( WINSYSDIR64^"rundll32.exe", printui.dll,PrintUIEntry /if /b "Printer 1" /f "c:\\windows\inf\oem12.inf" /r "Lpt1:" /m "Printer 1" /z /u,
WINSYSDIR64, SW_HIDE, LAAW_OPTION_USE_SHELLEXECUTE, LAAW_OPTION_SHOW_HOURGLASS);
When compiling I get printui: undefined identifier.
Am I barking up the wrong tree and is it even possible as a custom install script action?
I can make it work as a custom action -> New EXE - Stored in a binary table, however I have lots of these I wish to add so would like to do it in script.
Any help would be much appreciated.
Thanks in advance.
- Tags:
- cust
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 18, 2014
08:53 AM
It looks like you have a slight misunderstanding about the InstallScript programming language. The error you received indicates that it's treating printui as the name of a variable. If you want to treat it as (part of) the name of a file, it must be turned into a string by putting it in quotes.
So instead of printui.dll your code should have "printui.dll". But since that's just part of the overall arguments to the program, you'll really need
"printui.dll,PrintUIEntry /if /b \"Printer 1\" /f \"c:\\windows\\inf\\oem12.inf\" /r \"Lpt1:\" /m \"Printer 1\" /z /u"
instead (note the embedded quotes that are escaped by backslashes). Note that I haven't verified the command itself; I've just tried to convert what you posted into something that the InstallScript compiler will understand.
So instead of printui.dll your code should have "printui.dll". But since that's just part of the overall arguments to the program, you'll really need
"printui.dll,PrintUIEntry /if /b \"Printer 1\" /f \"c:\\windows\\inf\\oem12.inf\" /r \"Lpt1:\" /m \"Printer 1\" /z /u"
instead (note the embedded quotes that are escaped by backslashes). Note that I haven't verified the command itself; I've just tried to convert what you posted into something that the InstallScript compiler will understand.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 18, 2014
10:29 AM
MichaelU wrote:
It looks like you have a slight misunderstanding about the InstallScript programming language. The error you received indicates that it's treating printui as the name of a variable. If you want to treat it as (part of) the name of a file, it must be turned into a string by putting it in quotes.
So instead of printui.dll your code should have "printui.dll". But since that's just part of the overall arguments to the program, you'll really need
"printui.dll,PrintUIEntry /if /b \"Printer 1\" /f \"c:\\windows\\inf\\oem12.inf\" /r \"Lpt1:\" /m \"Printer 1\" /z /u"
instead (note the embedded quotes that are escaped by backslashes). Note that I haven't verified the command itself; I've just tried to convert what you posted into something that the InstallScript compiler will understand.
If I wanted to place a string variable as a replacement to c:\\windows\\inf\\oem12.inf would I put in in ' ' i.e. '\szDestinationInfFileName' as I can't get the compiler to like any combination tried double quotes, &&.?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 19, 2014
08:02 AM
For that you'll have to build the string up at run time. See the string operators, particularly + and ^ depending on which parts you know ahead of time and what you're concatenating together.