Jump to content

Anyone wanna test this? RunOnceEx Replacement.


Recommended Posts

from the readme.txt

Location of files has been hard-coded for the first CD-ROM Drive. For most installs this should be ok.

:no:

If we use RIS or WinPE to install Windows, source are not from a CD. It should be better to code the location from the root like a batch script.

if preinst.exe path is %~dp0, use %~d0 for initial path in instloader.ini. i.e.

c:\install\preinst.exe

c:\install\instloader.ini

c:\install\1stapps\1stsfx.exe /s

c:\install\2ndapps\2ndsetup.exe /QN

...

Using name that does not use 8.3 like instloader.ini is annoying. Just my own opinion. Why not using preinst.ini

Link to comment
Share on other sites


I agree that the default location to install programs from being the first cd rom drive isn't a great idea. Is there a way to make the program search for a file and set the variable to that drive.

What I'm trying to say is do some thing like what they do for runonceex, people use the following code to search for cd.txt and set the drive that has the file on it's root, a variable.

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:\CD.txt SET CDROM=%%i:

So now variable %CDROM% will be where the file CD.txt is found. I don't know much about basic, I can look around to see if I can make that work. Or simon if you have some sugestion you can chime in any time, I mean it is your code.

As for instloader.ini it appears very easy to just change the name of that file to blah.whatever if you feel like it.

Link to comment
Share on other sites

Okay after playing around with it I compiled an exe, which looks for preinst.ini on the root of every drive letter. If it finds that file it will use it as it's instructions file, the one previously named instloader.ini. It will then use what ever drive that file is on (the root of that drive) as it's base path.

So for example, I placed a file called preinst.ini which had these two lines in it.

installing Blocks Mavarious

bm.exe

in this case bm.exe is just a small game for testing purposes. when I run my new exe it will execute bm.exe if it's in the same directory as preinst.ini. I could change it to say

installing Blocks Mavarious

\Games\bm.exe

And you can image what would happen. I did run into one problem. It basically does a C:\preinst.ini exists set variable to C:\, I do that for all 26 drive letters. On the laptop I'm using to test this, I don't have a cd rom in it's drive E. so when it gets there it, it says "bad file name or number" I believe this is simply because I don't have any thing in the drive...but if I delete that line it works fine form either partition that I have.

In any case you can download it here good luck, source is included.

http://rapidshare.de/files/12474763/Applic...taller.zip.html

Edited by hooovahh
Link to comment
Share on other sites

WOW!!! Looks like you guys have been busy! Looks like we got a little open source venture going here.

Just added a little bit of extra coding to get rid of the white space problem altogether. In intLoopA, after the first line, add the command:

DoEvents

This will allow the text label to redraw whilst the external programs are being executed.

As I said before, VB6 is somewhat limited in what it can do, especially when it comes to shell commands, which is why I hard-coded the locations (Basic id***-proofing really). That said, I'm glad someone has come up with an alternative. I will take a good look at it when I get back from work in the morning (Graveyard shift tonight :} )

Link to comment
Share on other sites

I'm going to feel kinda embarassed when you see my source. you see I didn't know an efficient way to make a for loop that searched every drive letter, making the char code go up each time. So I simply made 26 practically identical pieces of code. I hardly touch any thing else of yours, and the variable names are all the same. If you'd like to take it and run with it be my guest, it is your program.

Link to comment
Share on other sites

This code is looking quite good. I played with it a bit to see how it stood up to a little abuse. As you said in an earlier post, you do run into a bad file error on a non-existent CD-Rom drive. If I get a bit of time, I'll put an error handler into the code so that we can use every drive letter. I'm trying to speed the code up a little (See code below). Code shown below also resolves the drive letters using a loop as you said before.

For intLetter = 67 to 90
If Dir(chr(intLetter) & ":\Preinst.ini") <> "" Then
'File Exists
GetFirstCdRomDriveLetter = chr(intLetter) & ":\"
End If
Next intLetter

Don't forget to declare intLetter (Dim intLetter As Integer)

Other than that, it works pretty well. I'm going to have another good cleanup of the code and sort out the error handlers as I said before. I'm also going to rename the INI file to something shorter, like config.ini or something like that (Hope that will resolve the ISO names issue). After that, I've got a WPI version of the same prog to work on.

Your input is greatly appreciated, which is why I left the source open in the first place.

Edited by simply_simon
Link to comment
Share on other sites

'prjPIE' was just the project name used in visual basic. I just hadn't bothered to change it (Lazy coding). If you are getting a 53 error, it means the program hasn't found the 'instloader.ini' file. In the version linked to in the first post, that file must be put in the system32 folder, along with the rest of the stuff in the archive. In Hoovahs rewrite, the file has to be put in the ROOT directory of whichever drive you want it put.

I'm in the process of doing a significant rewrite and will post a new version soon.

Link to comment
Share on other sites

I like to use this on my programs disk. As such, I would need it to be able to read its .ini file from the same directory the executable resides in, so that I can take it anywhere. Is this possible?

Link to comment
Share on other sites

Yes you can, but I suggest you use the newest version. I'm posting it here.

It's basically just a cleaned up version of hooovahh's interpretation, the source code is with it, in case anyone else has a copy of VB6 on their machine and wants to play with it.

You can actually run the program from wherever you like. The only stipulation is that the Preinst.ini file is on the ROOT of the drive that your installs are to run from.

I run my installs from the \Install\ directory on my CD ROM Drive. So, assuming my CD is D:\, I would have the following:

I put the preinst.ini file, the exe file and the exe.manifest file to the root of the CD. The OCX file needs to go in $OEM$\$$\system32\. I use a single line in RunOnceEx (No GUI) to call D:\preinst.exe. The ini file would be edited as follows

line 1: Installing program1

line 2: Install\program1.exe /s /n

This will do 2 things. Firstly, it will tell the program to display "Installing Program1" Above the Progress Bar. It will then run D:\Install\program1.exe (Note that you can use your installers switches too). Finally, it will update the progress bar.... and so on until it reaches the last one and finishes. It automatically closes when it's finished, although you can force it shut if you're rebooting your system afterwards.

Link to comment
Share on other sites

Thanks alot simon :hello: I really appreciate you fixing my code, and thanks for letting me tweak yours. I'll study some VB if I get a chance, thanks alot for making that for loop, while it seems easy and basic, I didn't know what to do, thanks.

I haven't had a chance to play with your revision of my code, but I'll definiatly be using it in the future.

Link to comment
Share on other sites

Finally CRACKED IT!!! I was still struggling with this Error 52 thing. It seems that it is just a limitation of the VB6 'DIR' command. I solved it with a FileExists function ('Borrowed' code, used with permission).

I've been busy testing, and can now assure everyone that it works with any drive letter from C to Z. I even tried mapping a network share to X:, which the program found too... So basically I am happy enough to put this out as a final version now.

Oh yeah. I made a new progress bar, so now I managed to get rid of the COMCTL32.OCX and the MANIFEST file in one fell swoop. Now you just get 2 files to use instead of 4. All in all, today's been a good day. The 'Final' version is here.

I've now updated the first post. The source is here if anyone wants to work it any further......

As always, all files can also be downloaded direct from my website.

Edited by simply_simon
Link to comment
Share on other sites

* Runs only one command per install (Multiple commands can be used in batch files, which are minimised upon opening, so the end user will not see commands being performed).
* Easily edited script file with two lines for each install.

Hmmm most programs need more then one , and have more lines then 2.

Any change this wil be possible in a later version?

Link to comment
Share on other sites

Simon great little app!

Can i make some requests please?

1. Being able to change the font? - Use standard system font for example?

2. More than one command line option - i have a cleanup that runs after each applications for things like icon placement etc - would like to be able to do that with your little app.

Also i noticed what may be a little bug - i had a test that had the preinst.ini in c:\ and then in the ini had paths such as e:\folder\app.exe /switch - this didn't work... that would be good to have also.

Thanks for your hard work - would be great if you include at least request 2.

PS if you would like somewhere to host the source and the files etc - am happy to host them on my website.

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

: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.

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...