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

Running Batch File (CMD.EXE), Registering DLL.


8 replies to this topic

Pramod Kaushik

Pramod Kaushik
  • Full Members
  • 8 posts

Posted 06 March 2014 - 00:56

Hello All, 

 

I am a new member and found this forum to be very informative. I have an old Installshield Professional windows installer software. I am trying to install and register a few dlls with this older version of Installshield. I read a lot of forums and pages to help me register some DLLs through installshield. I read a few brilliant articles but the problem is that my version of Installshield doesnt have COM self registration options. So I am left out with 2 options, either to create a batch file and call it to run or write an Installscript to register the DLLs.

 

When I tried writing Installscript for registering DLLs, I was encountered with a lot of errors that I could not debug. But I wrote a good batch file that copies vital data and also can register the DLLs for me. Now all I want the installshield to do it to run this batch file that I am calling. 

 

I tried using the custom action option and created a new custom action to run this bat file. so in this I chose type 2 (I want to run this after a few initial files are copied by installshield) and also since I will only be using the command prompt, I gave the Source value as [SystemFolder]cmd.exe and the target to be my batch file - "C:\PathToBatch\batch.batl" . I also created binary entries for these two paths as a reference. But when I build installshield, the command prompt is not called and the DLLs are not registered. 

 

Is there any other way which I could use to run the batch file. I just want Installshield to do a double click on that bat file for me and then am all done. 

 

 

Thanks All,

 

Hope someone helps me here 


Edited by Pramod Kaushik, 06 March 2014 - 01:05.


Pramod Kaushik

Pramod Kaushik
  • Full Members
  • 8 posts

Posted 06 March 2014 - 19:43

Also, my Windows installer software crashes after I build my project. Whenever I click features or a few other options in the software, the program freezes. I have tried uninstalling and reinstalling the software but it doesnt solve the problem. I also tried restore my system to a previous point to rollback changes done by the installshield software.. it still crashes. .. Any idea why this happens ? 



Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 12 March 2014 - 16:31

Installshield is the most comprehensive installation software out there, but in your case I think you may be better off trying AdvancedInstaller's free version to achive what you want without too many problems. Your requirements seem pretty simple. The free version only supports self-registration of files, and not extraction of the information though.

 

It is difficult to support and help people with older versions of software - we don't have the version installed, and there may be bugs we don't know about  and unknowingly lead you into. Perhaps you can give AdvancedInstaller a quick try, just search for it in Google.


Edited by Glytzhkof, 12 March 2014 - 16:34.

Regards
-Stein Åsmul

Pramod Kaushik

Pramod Kaushik
  • Full Members
  • 8 posts

Posted 12 March 2014 - 16:49

Thanks a lot for writing. I tried a few installation evaluation software but they do not allow me to publish my project. As I am working for a company, I want to publish it and make it professional. Will this free version let me publish the files ? 

 

Thanks again, 

Pramod 



Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 12 March 2014 - 17:10

The feature set in the free edition is very limited, but I do think it would cover your specific scenario, unless there are many other features you need. Perhaps you can give it a quick test spin, my knowledge of that software is limited. It has a lot of GUI features that appear simple to deal with.


Regards
-Stein Åsmul

Pramod Kaushik

Pramod Kaushik
  • Full Members
  • 8 posts

Posted 12 March 2014 - 21:47

I will check it out Stein. Thanks a lot for the replies again ! :) 



Pramod Kaushik

Pramod Kaushik
  • Full Members
  • 8 posts

Posted 13 March 2014 - 22:20

Can anyone explain where I am going wrong ? I have to run  a batch file that has the sql commands to run. I have to pass the servername, username and password to the batch. I am not able to run the batch file using LauchAppandwait. Let alone passing these parameters to the function. here is my code... 

 

eturn = LaunchAppAndWait(WINSYSDIR^"argtest.bat","", WAIT);  --- This is bringing up a cmd window in a flash.. but doesnt do anything else.. 

 

should I do eturn = LaunchAppAndWait(WINSYSDIR^"argtest.bat","username servername password", WAIT);  this to pass parameters ? ? 

 

When I run my batch from cmd, giving parameters, it works perfectly fine... 

 

can anyone help me with this ? 



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 14 March 2014 - 19:20

I don't think you can execute a .bat directly. Instead you may need to run cmd.exe and pass the .bat in the command line.

 

I'm not sure what you are doing here. It looks like you are adding more and more levels of complexity. What project type are you using really?



Pramod Kaushik

Pramod Kaushik
  • Full Members
  • 8 posts

Posted 14 March 2014 - 21:32

Thanks a lot for the reply stefan. I am using a baisc MSI project and I figured out that custom action wizard was better than installscript and I was doing mistakes with both. I am novice and this is really my first project. so u can imagine y am pretty rusty about it.

 

Also, I tried cmd.exe with batch file as a parameter and dint help me much as I wanted to pass parameters to the batch file too.. [it dint even call the batch file in my case :(]

 

 

The custom action type 34, with executable and directory table helped me. I was able to run a batch file directly and could pass parameters to batch. These parameters were environment properties. So my custom wizard looked something like this. 

 

Type 34 

Source : [ProgramFileFolder]path\to\bat

Target:  yourbatchfile.bat [para1] [para2] [para3] "[programfilefolder]path\to\other\executables]"   {for users like me who struggled to pass parameters to batch file; use %1 %2 %3 %4 in your batch script for the parameters/variables respectively}

 

 

am really not sure if this is a safe practice. para 1 para2 para3 were servername user name and password. I could not find a better way to run my sqlcmd except for this. I tried this and it works. Is this a recommended way of doing it ? also since I have a very very old version of installshield, I do not have too many features. 

 

 

Thanks once again stefan for trying to help me. I understand from the number of posts and ur profile that u r awesome !! Thanks again!