Jump to content

Anyone wanna test this? RunOnceEx Replacement.


Recommended Posts

:thumbup Hello simon, wonderful job, it's awsome that it's only 2 files now. Also thank you so much for actually crediting me for some of the work done on this code. I simply played with the interface and did some other small tweaking, and you still mentioned my work in the readme and the source.

I like the new progress bar too. Thank you so much simon, this being your "final" version I don't think we'll be talking about this app much any more. But it's been really nice talking to you, and I hope our paths cross again some time.

@felix

I understand you're requests and I sugest you download the source and play around with it. Thats all I did, and changing the font has to be one of the easiest things to do in VB.

Also the bug you mentioned isn't really a bug at all, where ever the preinst.ini file is found is going to be its base path, so if you want to install some thing from the E:\ drive then put preinst.ini at the root of that drive.

Hi ya and thanks for your response... being a very novice VB person (very very basic - am a JS person) i am not sure how to compile etc... if you can give me a few pointers etc i would appreciate it :D

Link to comment
Share on other sites


Sure I'll tell you all I know www.google.com there.

Aside from that play around, just open the code, and the whole UI is basic, all click and drag for moving things, and changing fonts.

Then to compile it should be File create exe that's it.

sorry for such a short reply I'm late for a meeting.

good luck

Link to comment
Share on other sites

@Felix. Thank you for your feedback. Compiling within Visual Studio 6 is just a case of clicking 'File/Make ****.exe'.

I know I've said it's a 'Final' version, but doubtless I'll still need to make some revisions at some point. I've listened to comments and I'm definately listening to your requests.

I've started writing up some new coding to use tags from within the INI file. What I intend to do, is to factor in three main tag types... LBL will be the text label for the current action, PRG is the installer to run, and DOS will be a new feature that will allow pure DOS commands to be run (Such as terminating programs etc). As I said before, I personally prefer to do all that sort of thing within a BAT or a CMD file, but if you want multiple lines, well hey, I'll give 'em to ya!!! The tags will basically just be like HTML style things. Any Ideas for further configurations using these tags perhaps people???

Visual basic is a lovely thing to play around with, and a lot of the basic commands, such as For/Next loops and If/Then statements, are things I used to mess with when I was at school (20 odd years ago). The rest is very simple to pick up. Most of the visual properties can be changed within the program code, such as Text1.text = "hello" which would put the word Hello into Text1's textbox. There are many many tutorials online and plenty of downloadable code snippets to help you. Unfortunately VB6 is a dying breed, thanks to the .NET era, but the runtime files needed are already installed with XP, whereas .NET framework needs to be installed.

Link to comment
Share on other sites

@Felix. Thank you for your feedback. Compiling within Visual Studio 6 is just a case of clicking 'File/Make ****.exe'.

I know I've said it's a 'Final' version, but doubtless I'll still need to make some revisions at some point. I've listened to comments and I'm definately listening to your requests.

I've started writing up some new coding to use tags from within the INI file. What I intend to do, is to factor in three main tag types... LBL will be the text label for the current action, PRG is the installer to run, and DOS will be a new feature that will allow pure DOS commands to be run (Such as terminating programs etc). As I said before, I personally prefer to do all that sort of thing within a BAT or a CMD file, but if you want multiple lines, well hey, I'll give 'em to ya!!! The tags will basically just be like HTML style things. Any Ideas for further configurations using these tags perhaps people???

Visual basic is a lovely thing to play around with, and a lot of the basic commands, such as For/Next loops and If/Then statements, are things I used to mess with when I was at school (20 odd years ago). The rest is very simple to pick up. Most of the visual properties can be changed within the program code, such as Text1.text = "hello" which would put the word Hello into Text1's textbox. There are many many tutorials online and plenty of downloadable code snippets to help you. Unfortunately VB6 is a dying breed, thanks to the .NET era, but the runtime files needed are already installed with XP, whereas .NET framework needs to be installed.

Simon, this is excellent news - thankyou!

The only other thing i can think of at the moment is that you could have 3 other tags in the ini file. 1. font="fontname", 2. fontcolor="fontcolor (name i.e. red or hex i.e. #ffffff)" and 3. bgcolor="background color (name i.e. red or hex i.e. #ffffff)". Just some thoughts, don't know how hard or if you want to do it, but your asked for more ideas ;)

I think most people these days install .net - it may be worth while coding in vb.net as Windows Visa may not include the required VB6 files needed? just a thought...

Thanks again!

Edited by `Felix`
Link to comment
Share on other sites

I had already figured on a font tag, but not colours. The background's a bit much to mess about with right now, but changing the colour of the progress bar is another option I'll sort. Also I'm going to allow the user to edit the title of the window and the text labels too. The coding's a lot easier than I expected, so it shouldn't be too long before I have a version done.

With regards to Vista, Microsoft have apparently stated that it would be backward compatible with older software, so hopefully it will still continue to support the runtimes for VB6. As for VB.NET, hopefully Vista will be rolled out with the runtimes already installed because you'd have to RunOnceEx twice in order to use a VB.NET program to install applications like we are with XP.

UPDATE: Okay, here's what I've done. I've left the font colours as-is for now, but you can now change an awful lot of what you see in the interface. As promised, I've brought in the tags and they seem to work rather well. I've released this one for download so see if it improves on the last one at all.

Here is what the 'preinst.ini' file now looks like.

Application Installer Configuration File
---------------------------------------
#The 5 tags below are crucial for the program to run
#Edit by all means but do not delete or comment them out!!!
<TiTle>Finalizing Windows Install
<Text1>Windows Is Installing Your Software. Please Wait.....
<Text2>Current Action....
<Font>Times
<ProgColor>blue
---------------------------------------
#Any combination of tags <lbl> <prg> or <dos> can be used below,
#but every <lbl> tag will be counted when updating the progress bar.
#KEY: <lbl>Text label of action (EG 'Installing Blah Blah').
# <prg>A program or command to be run from this location.
# <dos>The same as using Start\Run (EG. Terminate).
#
<lbl>Example(1)
<prg>Rawritexp.exe
<dos>calc
<lbl>Example(2)
<prg>Rawritexp.exe
<dos>calc

I think it should make it clearer as well.

Edited by simply_simon
Link to comment
Share on other sites

@ Muiz, If you're still there, you asked at the beginning, how you'd do that ad-aware thing yeah??

This would be what you'd now get:

<lbl>Installing Ad-Aware Pro SE V1.06
<prg>Software\adaware\adaware.exe /S
<dos>taskkill /IM Adaware.exe /F
<dos>taskkill /IM hh.exe /F
<dos>taskkill /IM Ad-Aware.exe /F
<prg>Software\adaware\defs.exe
<prg>Software\adaware\dutch.exe
<prg>Software\adaware\sites.exe
<prg>Software\adaware\Lavasoftprefs.exe

Would that maybe interest you? Try it and see if it goes for you.

Link to comment
Share on other sites

Hi there Simon,

Well i have been trying to get this little tool to go for days and have tried all manner of things to make it work without success. You will see my bit of test preinst.ini file below. From this when run i can get the first and the last option to install without problems, however nothing else installs as it should. They flash up, but the installers don't run.

Please tell me where i am going wrong?

Application Installer Configuration File
----------------------------------------
#The 5 tags below are crucial for the program to run
#Edit by all means but do not delete or comment them out!!!
<TiTle>Application Installation
<Text1>Installing Your Software Please Wait.....
<Text2>Currently installing
<Font>system
<ProgColor>blue
----------------------------------------
#Any combination of tags <lbl> <prg> or <dos> can be used below,
#but every <lbl> tag will be counted when updating the progress bar.
#KEY: <lbl>Text label of action (EG 'Installing Blah Blah').
# <prg>A program or command to be run from this location.
# <dos>The same as using Start\Run (EG. Terminate).
#
<lbl>Gif Movie Gear 4.2
<prg>apps\moviegear\moviegear42.exe /VERYSILENT
<dos>apps\moviegear\moviegear-cleanup.cmd
<dos>REGEDIT /S apps\moviegear\register.reg
<lbl>Macromedia Dreamweaver 8.01
<prg>apps\dreamweaver\dreamweaver8.msi /qb-!
<dos>apps\dreamweaver\patchpackage.msp /qb-!
<dos>apps\dreamweaver\license.exe
<lbl>VMware Workstation 5.5
<prg>apps\vmwarewkst\VMware_Workstation.msi /qb-!
<dos>REGEDIT /S apps\vmwarewkst\register.reg
<lbl>Quick Batch File Compiler 2.0.7.0
<prg>apps\utils\qbfc2070.exe

Link to comment
Share on other sites

@felix. Was trying not to complicate things too much, which was why I suggested using a batch file for Multi-line installs.

Basically, the <prg>line runs from the location where the preinst.ini is. The <dos>line runs from the system (Exactly the same as if you'd used "Start\Run" or opened a command prompt) The DOS commands are only needed if you need to run a command from the system (Such as taskkill). I suggest the easiest way to attack this would be to put all the commands into a CMD or a BAT file in the app folder and call it run.cmd os something like that. Then just run that instead. One of your examples for a CMD file is below...

@echo off

start /wait dreamweaver8.msi /qb-!
start /wait patchpackage.msp /qb-!
start /wait license.exe
exit

You'd then put two lines down for your config.

<lbl>Macromedia Dreamweaver 8.01
<prg>apps\dreamweaver\run.cmd

I know that batch files seem a little messy, but I coded the program so that anything it starts is automatically minimized. Of course, you can hide the Command windows with CMDOW if you like, but at the RunOnceEx stage, you'll barely notice them anyway.

Please tell me if you need any other help.

EDIT: Just to add, I've been experiencing difficulties installing certain msi based installers. These seem to exit with an error like "Please go to the Control Panel to configure components". Once rebooted, I ran the same installers and they worked perfectly. So I'm now doing another run with a shortcut to the preinst.exe file in the startup folder instead of RunOnceEx stage, so that it starts once the full Windows GUI is loaded (I'll delete the shortcut before rebooting, or it'll start every time windows loads). I'll let you know how it progresses.

Edited by simply_simon
Link to comment
Share on other sites

Thanks for your reply and help simon...

I have finally cracked it after thinking about it and doing some further testing. Firstly i remembered that you need to use "StartX.exe" with msi's used in this manner (start /wait - will not work)... and of course you need to call the complete command string. So below is the correct syntax etc to actually run msi's from your util. You may want to include this information in your documentation. Also for anyone that does have STARTX.EXE - you can download it here

Application Installer Configuration File
----------------------------------------
#The 5 tags below are crucial for the program to run
#Edit by all means but do not delete or comment them out!!!
<TiTle>Application Installation
<Text1>Installing Your Software Please Wait.....
<Text2>Currently installing
<Font>system
<ProgColor>blue
----------------------------------------
#Any combination of tags <lbl> <prg> or <dos> can be used below,
#but every <lbl> tag will be counted when updating the progress bar.
#KEY: <lbl>Text label of action (EG 'Installing Blah Blah').
# <prg>A program or command to be run from this location.
# <dos>The same as using Start\Run (EG. Terminate).
#
<lbl>Gif Movie Gear 4.2
<prg>apps\moviegear\moviegear42.exe /VERYSILENT
<dos>apps\moviegear\moviegear-cleanup.cmd
<dos>REGEDIT /S apps\moviegear\register.reg
<lbl>Macromedia Dreamweaver 8.01
<prg>startx /wait "msiexec /i apps\dreamweaver\dw\dreamweaver8.msi /qb-!"
<prg>startx /wait "msiexec /update apps\dreamweaver\patchpackage.msp /qb-!"
<dos>apps\dreamweaver\license.exe
<lbl>VMware Workstation 5.5
<prg>startx /wait "msiexec /i apps\vmwarewkst\VMware_Workstation.msi /qb-!"
<prg>REGEDIT /S apps\vmwarewkst\register.reg
<lbl>Quick Batch File Compiler 2.0.7.0
<prg>apps\utils\qbfc2070.exe
<lbl>Registry Fix 3.0
<prg>apps\registryfix\registryfix.exe /VERYSILENT
<dos>REGEDIT /S apps\registryfix\register.reg

Hope this information is valuable. Further if you are running clean-ups of shortcuts and other stuff as i am here, then i suggest as Simon has earlier to run each app and related clean-up, reg adds etc from a cmd file. You can hide them easy with cmdow or even better RunHiddenConsole.

Edited by `Felix`
Link to comment
Share on other sites

@Felix. You still have some syntax wrong there. If you're using a <dos> line, you will have to give an ABSOLUTE path to your end file (You can't just REGEDIT a file from the command line without telling the command line where that file is. You could try running the regedit from the <prg> line. I haven't tried it yet)

For Example, the code

<dos>REGEDIT /S apps\moviegear\register.reg

will not work, because the <dos> line works directly from the system. It will try to find the 'apps' folder in the 'system32' directory. It's an unfortunate limitation I'm afraid. Hopefully someone else could crack something a little better. (There could be a REGEDIT workaround. Try copying regedit.exe from the system folder into your app's install directory and call it from <prg>. Again, not tested)

Of course, if you know the location of your 'apps' file (EG %CDROM%) you could always put

<dos>REGEDIT /S %cdrom%\apps\moviegear\register.reg

Unfortunately the problem arises out of the principle of the CD-ROM not always being in the same place. A complete workaround would be to put all the Installs to a folder on the system drive and run them from there, but this isn't ideal for everyone.

UPDATE: I may have found an answer, but it'll require some more coding. I'm going to simplify things and get rid of the dos command. I'll use a wildcard (Maybe an asterisk *) to specify the root location (So you'll get this.

<cmd>REGEDIT /S *\apps\moviegear\register.reg

I think <cmd> would be a better tag than <prg>. The * will represent the location of the 'preinst.ini' file and therefore, the root of your installation. I'll code this up tomorrow (Doing the Math tonight).

Just to add to my earlier dilemma, my errant MSIs still didn't install properly until after rebooting, so I've come up with another plan. I've compiled another EXE, this time called 'preins2.exe' and changed the coding to call for 'prein_2.ini'. What this means, is that I am now able to run a second instance of the program after the reboot (called with RunOnceEx just like the last one) and install the prorams that were giving me grief... Well that's the plan anyway. If I'm successful, I'll update the download accordingly.

Edited by simply_simon
Link to comment
Share on other sites

Thanks again Simon - I am still testing and i should have taken the rest of the stuff out, as i was mainly working to get the msi and msp files working.

Can i make some further suggestions...

1. Would be great to have an in-built %CDROM% detect for example

FOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\preinst.ini SET CDROM=%%i:

2a. A common thing that lots of people will do is add registry settings - so i suggest that if the line is something like

apps\registryfix\register.reg

That your app reads the .reg part and automatically prefaces the line with REGEDIT /S

2b. A similar thing could be done for .msi and .msp files. e.g. startx /wait msiexec /i for .msi and startx /wait msiexec /update for .msp

3. Allot of people will also obviously be running cmd/dos commands and will want them hidden. Have you had a look at RunHiddenConsole (the source is in the thread) You may like to include this in your app so that cmd/dos windows are hidden.

Just some thoughts & suggestions :D

Edited by `Felix`
Link to comment
Share on other sites

@Felix. OK i've put in the WildCard function now and updated the link. You have made some good comments about the program so I thought I'd continue by answering some of them.

Firstly, You mentioned locating the CDROM. The program already does this by looking for the preinst.ini file. I've even had this on a network drive and ran installers from there, so it's even more versatile.

With regards to the rest of your suggestions, I would prefer to keep the INI file as close to RunOnceEx syntax as possible (Barring the WildCard thing of course), so I'm leaving the rest as-is for the time being. Take a look at it and see if you can figure it out. I tried duplicating your install, using these commands and they worked like a charm:

<lbl>VMware Workstation 5.5
<cmd>startx /wait "msiexec /i *\apps\vmwarewkst\VMware_Workstation.msi /qb-!"
<cmd>REGEDIT /S *\apps\vmwarewkst\register.reg

StartX is in the system32 folder in this example. Basically, the program now has a command to replace any instance of the '*' with the drive letter of wherever it finds the 'preinst.ini' file.

I think I may have to start a new thread soon. This one's getting a bit long.

Link to comment
Share on other sites

Thanks Simon,

I am doing some testing today of this update. Further, you should simplify the need for preinst2/3 my just changing some of the code for the original preinst to use a command line option for example:

preinst.exe /preinst2.ini

In this way you only need the one .exe file and you don't have to have the .ini file as the default name.

Just a suggestion :D

Link to comment
Share on other sites

Suggestion taken on board, thank you. I have one for you too, if you want it... Avoid the need for StartX by making 7Zip installers. Makes the configuration of everything else much simpler. I just made one for VMWare that includes the serial, all nicely packaged into one switchless exe file.

Edited by simply_simon
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...