daddydave
Content Type
Profiles
Forums
Events
Posts posted by daddydave
-
-
New version! Bug reports welcome!
I caught a break when the AutoItv3 people (or person, Jon Bennett) added built-in Unicode support sooner than I thought. Then I had to write a CheckBOM function to test whether the file was UTF-8, or one of the flavors of UTF-16, or ANSI, edited a couple more lines and then I was done.
0 -
So this doesn't create a cabbed version of the driver?
No, but HFSLIP adds the drivers to DRIVER.CAB.
0 -
is there some instructions for drivercabhelper? What to put where? Do I use this before HFSlip? How do I set it up to use with HFSlip? Do I run this within Hfslip?
John
The instructions are in the first post in this thread. Notice from the screenshot it is interactive. It runs prior to running HFSLIP and preps the DRIVERCAB folder for HFSLIP according to Oleg_II's specs. (Follow the links to Oleg II's method thread and Tomcat76's clarification thread.) It is not necessary to re-run it every time you run HFSLIP, just run it once after you are finished creating the source folder containing all your drivers and INF files.
The only thing DrivercabHelper does is copy the files from the source folder to the destination folder, in the process modifying the INF files to Oleg_II's specs. By design, it will erase anything in the destination folder before copying files there. The destination folder is ultimately HFEXPERT\DRIVERCAB. The Unicode file bug is still there, I had hoped to fix it by now but I haven't had time.
Hope this helps answer your questions.
0 -
thx
i used: /qn /passive
is it normal that the .ini files does not show the commands?
The ini will not show the command line switches because the .exe is the self-extractor, not the original setup.exe
So if you every need to run the silent installer directly instead of usgin an addon, you can just extract it out of the .cab and not use the .ini.
0 -
At this point I'm more interested in comments on the "alternate input folders" feature. At the current rate of interest it won't make it into the final...
Perhaps if I understood their intended purpose...
0 -
LeveL.
you are right, we are saying the same, I was just being redundant
So use one of these, not HFSLIP folders:
$OEM$\C -- Copy subfolders to C drive
$OEM\1 -- Copy subfolders to %SYSTEMDRIVE% which often is C
which the original poster seems to already know about
0 -
A variation on LeveL's idea is to create an addon for HFAAO using install.cmd (or whatever you call the batch file) as the installation program, and have a line that goes something like:
xcopy mytools\* "%systemdrive%\mytools" /I /C /Q /Y /H /E
Or whatever path you want off the system drive.
I would recommend Addon Maker for nLite for this, and the batch file is automatically hidden.
Also, and this may be HFSLIP heresy, there's no law against using $OEM$ in the SOURCE, so why duplicate that functionality?
0 -
Seems I was overthinking it; I don't think I really need to read it and write it as Unicode, I just need to read it and write it as bytes. Something like (just to prove the concept):
$writeTo = FileOpen(".\binary-write.txt", 2);
If $writeTo = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf
$bin = BinaryString(30);
$bin = Chr(0xff) & Chr(0xfe) & Chr(0xac) & Chr(0x20) & Chr(0x20) & Chr(0) & chr(0x60) & Chr(0x01) & Chr(0x20) & Chr(0x00) & Chr(0x18) & Chr(0x20) & Chr(0x20) & Chr(0x00) & Chr(0x19) & Chr(0x20) & Chr(0x20) & Chr(0x00) & Chr(0xa1) & Chr(0x00) & Chr(0x20) & Chr(0x00) & Chr(0xa2) & Chr(0x00) & Chr(0x20) & Chr(0x00) & Chr(0xa3)
FileWrite($writeTo, $bin)
FileClose($writeTo)0 -
[thought balloon]I wonder if I can convert Unicode to ANSI and back to Unicode [/thought balloon]
0 -
C++ could be a little frustrating for a beginner, but I agree that is where real programming takes place, BUT I myself have been messing with AutoIt3 (with Koda with GUI creation), and I am struck by it serves the same role BASIC used to in the 80's. A nice entry level language for non-programmers to get their feet wet, and high-level enough to make useful little scripts to use around the house .
Anyway, I'm a non-programmer, so what do I know, I had a little program on the side I was writing in C++ since I was trying to put my best effort into it, I kind of abandoned it though.
0 -
I read about Unicode2ANSI conventer somewhere on the sites about BartPE...
Is converting it to ANSI the right thing to do? What about characters that can't be represented in ANSI?
0 -
I can confirm that Lindiro's inf does show up as "UCS-2 little endian" in Notepad++.
Not sure what to do yet. (rewrite in from scratch in Python?)
I could warn the user, that could be a good interim band-aid, but I'd really like to able to just handle it.
0 -
This might not be an easy fix, since AutoIt3 doesn't support Unicode either.
EDIT: Or not
0 -
A bug in DrivercabHelper has been reported. It does not currently handle Unicode files. If you are using DrivercabHelper and you run into issues with a particular driver, make sure the output INF file for that driver isn't mush. Workaround is to edit that INF manually as per Oleg_II's original instructions.
You can track the progress of this bug in the main DrivercabHelper thread in my signature.
0 -
@Lindiro: Thanks for the bug report. Could you attach the original inf file as well?
0 -
I looked at creating INF's, but I don't want to redesign my generalized install.cmd too much
I still think it's best for my application to use at the time of addon creation rather than during installation
With that in mind, I took another look at Shortcut.exe because I couldn't figure out how to make get nircmd to create shortcuts with a Target in %ProgramFiles% rather than C:\Program Files. It looks good, it clearly documents how to do that.
If you check out the link above to the generalized install.cmd, you'll see I want the __sp folder to be populated with shortcuts, and I have a __pf folder to be copied to %ProgramFiles%. So I'm all about right clicking the __pf folder and choosing "Make shortcuts in corresponding __sp folder" or something like that. I expect that to be pretty simple using Shortcut.exe. Thanks for all the suggestions
0 -
Ooo very nice, just the other day I was thinking about something along these lines, then I see this post! Brilliant script!
Thanks!
0 -
I dont understand why you need to add it to every addon, once its in the system32 directory its can be use with a simple call. (like calling regedit or notepad, just call the exe.) The reason for putting it in system32 is system32 is always in the %PATH% environment variable, so it will always find an exe in system32.
Well, I have downloaded many application addons, and every one I've seen is self-contained. The only one I have seen that has a prerequisite is one I created for myself that ended up needed reg.exe (on Windows 2000, where it is like a resource kit utility unlike XP where it is part of "Windows").
People are not going to use the tool I am creating (a generalized install.cmd) if every addon they create with it has that kind of dependency. Then again, they might not use it anyway
0 -
Ever wanted to create an application addon for a program that didn't really need a setup program, but felt it should have a proper folder in %ProgramFiles%, some shortcuts in the start menu, and a rudimentary but functional entry in the Add/Remove Programs applet, using a generalized install.cmd that rarely has to be edited?
No? OK, I'll go away then. That's what I wanted. So if you are me, here is how you work the Universal install.cmd. (Knowledge of how to create addons using Addon Maker for nLite or another method is assumed.)
Create an empty folder and put install.cmd in it. Give that folder two subfolders called __pf and __sp (double underscores). __pf contains folders that are to be copied to Program Files, and __sp contains folders of Start Menu shortcuts that are to be copied to the Start Menu\Programs for all users.
Each folder directly under __pf corresponds to an entry to be added to the Add/Remove Programs applet. The folder names under __sp must match up to the folder names under __pf.
To summarize the folder structure:
addonfolder
Drop install.cmd here
addonfolder\__pf\appname
Put appname's files here to be copied to %ProgramFiles%\appname during installation.
addonfolder\__sp\appname
Put appname's shortcuts here to be copied to Start Menu\Programs\appname during installation. This is the not-so-fun part. I create them manually for now. Unfortunately unless %ProgramFiles%\appname\appfile actually exists, Windows will not let you create a shortcut to it. So to create the shortcuts, I have been copying my app files to %ProgramFiles% so I can create the shortcuts. Having to create the shortcuts for this folder manually at design time will be a deal breaker for some people, and I am looking into ways to make this easier in the future. Try to make the shortcuts point a path beginning with "%ProgramFiles%" rather than "C:\Program Files".
IMPORTANT: Make sure you use the same appname in __pf as you do in __sm.
Once I had the basic functionality working, it was simple to add support for multiple apps. So you can do the same for appname2, appname3, etc. in the same application addon. The appname from each top level folder in __pf is used in the Add/Remove Programs applet, and the uninstall worked during testing on a Windows 2000 box (be aware that a cmd window is briefly visible during uninstall).
Next step is to run carnificina's excellent Addon Maker for nLite (or some other method, although this is my preference), choosing install.cmd as your setup program and create your addon. These addons work fine with HFSLIP as well as nLite. Addon Maker will automatically cause the addon to hide the cmd window during installation.
---------------------------------------
IMPORTANT NOTE FOR NON-U.S. USERS
You will have to modify this line in install.cmd so that it points to the correct folder name. Use the same syntax as below:
set PROGRAMS=Start Menu\ProgramsExample (French):
set PROGRAMS=Menu Démarrer\ProgrammesI'm not sure about the U.K. Is it Start Menu\Programs or Start Menu\Programmes?
---------------------------------------
Credits
Thanks to everyone on the MSFN forums who responded when I had questions as I was writing this
To get the code take the following and paste it into a file install.cmd
REM Generalized install.cmd for application addons (HFSLIP, nLite, RyanVM's, etc.)
REM by daddydave
REM See MSFN forum for instructions
REM [url="http://www.msfn.org/board/index.php?showtopic=91889&st=0#entry619670"]http://www.msfn.org/board/index.php?showto...t=0#entry619670[/url]
REM ****************************************************
: Non-U.S. Users must change this line:
set PROGRAMS=Start Menu\Programs
REM ****************************************************
setlocal enableextensions
xcopy __pf\* "%ProgramFiles%" /I /C /Q /Y /H /E
xcopy __sp\* "%ALLUSERSPROFILE%\%PROGRAMS%" /I /C /Q /Y /H /E
for /D %%Z in (__pf\*) do (
>%TMP%\__install-%%~nZ.reg echo Windows Registry Editor Version 5.00
>>%TMP%\__install-%%~nZ.reg echo.
>>%TMP%\__install-%%~nZ.reg echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%%~nZ]
>>%TMP%\__install-%%~nZ.reg echo "DisplayName"="%%~nZ"
>>%TMP%\__install-%%~nZ.reg echo "UninstallString"="cmd /c >\"%%TMP%%\\__uninstall-%%~nZ.reg\" echo Windows Registry Editor Version 5.00&>>\"%%TMP%%\\__uninstall-%%~nZ.reg\" echo.&>>\"%%TMP%%\\__uninstall-%%~nZ.reg\" echo [-HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%%~nZ]&>>\"%%TMP%%\\__uninstall-%%~nZ.reg\" echo.&rd /S /Q \"%%ALLUSERSPROFILE%%\\Start Menu\\Programs\\%%~nZ\"&rd /S /Q \"%%ProgramFiles%%\\%%~nZ\"&\"%%SystemRoot%%\\regedit\" /s \"%%TMP%%\\__uninstall-%%~nZ.reg\""
>>%TMP%\__install-%%~nZ.reg echo.
"%systemroot%\regedit" /s "%TMP%\__install-%%~nZ.reg"
)0 -
?
XXMKLINK.EXE, the utility I linked to, is only 48KB
Ah, ok, I only saw XXCOPY on that page, but now I see the other program at the very bottom.
If you need help with the inf file stuff, I know there have been examples, including my own, posted here on these forums.I figured as much Thanks!
0 -
Why not just script the shortcut creation at installation time!
You could use a 3rd party utility such as this in a batch file; or built in tools such as vbs or inf?
xxcopy.exe has a packed size of 123k. Rather than putting 123k of overhead in every addon of this type, I would be better off using a real installer like the excellent NSIS, really simple to use if I use the script wizard in HM NIS Edit, and 34K overhead. (not to mention the fact that the free xxcopy is only free for personal use, which would prevent people from ever using the addons commercially.) Shortcut.exe from OptimumX, which may be the one phkninja is using, has about a 21k packed size, so that would more viable. Even nircmd, which has numerous functions other than shortcut creation, has a packed size under 24K.
You also mentioned INF and VBS at installation time, which sound like good options, since they are built into Windows, and I'm not too familiar with INF files that create shortcuts so I am going to figure out how to do that. Thanks for the tips.
0 -
Thanks, phkninja, but what is the shortcut command in the batch file, a third party utility? The reason I am copying the shortcuts at instatll time is to avoid having to embed a third party utility in the addon (other than batchrunner, which gets put in automatically by Addon Maker for nLite and serves the same function as cmdow.)
EDIT: looks like shortcut is a resource kit utility but same principle applies, I am trying to reduce dependencies on other tools so this can be as general as possible. Thanks anyway
0 -
make a shortcut (.lnk) to where you want it to go then use a batch to copy the shortcut in....(meaning you have a batch file and a shortcut file on your unattended install)
That's exactly hat I'm doing, but the problem is that if I try to create the shortcut to blah.exe without first copying the item to which the shortcut points to C:\Program Files\Blobbity, I get the error "%ProgramFiles%\Blobbity\blah.exe" cannot be found. I am creating the shortcuts ahead of time, rather than creating them during the install of the addon.
There's probably no such tweak for what I'm asking for, so I'll go ahead and create the shortcuts with something else such as nircmd.
And of course it won't kill me to go ahead and copy the program files to %ProgramFiles% at design time, but if there are multiple folders under program files, I have to make the shortcuts one folder at a time.
Interesting nickname you have, I tend to call my working folders "blah", I guess we have something in common.
0 -
This is a going to sound like a crazy question, I admit, but you know how when you go through the New Shortcut wizard, and it says "Type the location of the item:", it doesn't let you create a shortcut to an item that doesn't exist? Is there any registry tweak that will cause the Windows shell to let you create the shortcut anyway even though it's invalid?
In case you are wondering, what I am trying to do is create an application addon that copies a bunch of shortcuts to Start Menu\Programs which will be valid at the time of installation, but not necessarily on the machine I create the addon with. I have already discovered nircmd will let me create the invalid-at-design-time shortcuts, but I am curious if there is some trick to force the Windows 2000 or XP shell to do the same.
0
DrivercabHelper Version 1.1
in HFSLIP
Posted
Fixed now, thanks!
I thought I had fixed that, but I had to go back in the "user friendly" freewebs editor and click Done one more time.