cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
hogwell
Level 3

Cannot run executable (even notepad) - Error 1721

I need to Add a Printer during my Basic MSI installation and will need to call the standard Windows VBScript, prnmngr.vbs by running cscript.exe.

I am trying to use the standard action to run an executable, but I'm always receiving Error 1721. (Running on Vista SP1 with UAC disabled).

I'm placing the CA to run in the Execute sequence between InstallInitialize and InstallFinalize.

I know to run cscript to add a printer, I will need to schedule it Deferred with System Rights.

But I can't even create a simple CA to run c:\windows\notepad.exe no matter how I schedule it...

MSI (s) (F4:64) [10:06:42:916]: Note: 1: 1721 2: LaunchNotepad 3: 4: c:\windows\notepad.exe

Is it even possible to launch an executable from an msi using Windows Installer 4.5 on Vista or Windows 7?

Would I have more success writing an Installscript CA that calls LaunchAppAndWait?
Labels (1)
0 Kudos
(3) Replies
RobertDickau
Flexera Alumni

Yes, custom actions to launch executables are certainly supported in that environment. For the basic sanity check, is notepad.exe definitely in that location? In Windows Server 2008, for example, Notepad is in the system folder and not the Windows folder...

Does it work if you launch an executable you're installing (assuming the action is in deferred mode and not immediate mode)?
0 Kudos
hogwell
Level 3

Thanks for replying to my post.

Yes, I cut and pasted directly from the "Filename & Commandline" edit box in Installshield to my File - Run dialog.

c:\windows\notepad.exe runs fine then.

But there must be something I'm doing wrong...
Or Vista security is extremely strict for installers.

By the way, I'm using Windows Installer 4.5 and my Setup release is configured to require Administrator privilege.
0 Kudos
hogwell
Level 3

I was finally able to get notepad to run by scheduling the CA as Deferred rather than Immediate.

But it looks like the actual solution was to change the default for Working Directory to something.
(Installshield's default was blank.)

I didn't need the command (e.g. notepad) to run in any particular folder, but I set the Working Directory to 'INSTALLDIR' anyway and this removed the Error 1721 and the command now runs successfully.

Even better, my cscript call to prnmngr.vbs to add a printer works also.

This took me several days of trial and error to resolve.

I hope this post is helpful to someone else trying to use a CA to run a program.
0 Kudos