How to: Make a simple snapin-Start to finish
-
Hi thought this might help people. If you are using both Windows 7 32 bit and 64 bit, and the installer has two versions (32 and 64) you can use this simple script to determine OS. Because only windows 7 64 bit has this directory:
“C:\Program Files (x86)”
Then the script can check this and know the machine is 64 bit. Maybe it’s not a very technical way of doing it but it works just fine. So below is a script you can use, just copy and paste it into a .cmd file.
:::::::::::::::::::::::::::::::::
@ECHO OFFif not exist “C:\Programdata” goto XP
if exist “C:\Program Files (x86)” goto METHOD2
if exist “C:\Program Files” goto METHOD1::::::::::::::::::::::::::::::::::
CLS:METHOD1
Color 1F
CLS
@ECHO 32 BIT OS DETECTED…INSTALLING BLANKSLEEP.exe 5
START BLANK.EXE
goto :FINISH32
::::::::::::::::::::::::::::::::::
:METHOD2
Color 4F
CLS@ECHO 64 BIT OS DETECTED…INSTALLING BLANK.EXE
SLEEP.exe 5
goto :FINISH64
::::::::::::::::::::::::::::::::::
:XP
Color 9F
CLS@ECHO XP OS DETECTED…INSTALLING BLANK.EXE
SLEEP.exe 5
goto :FINISHXP
::::::::::::::::::::::::::::::::::
:FINISH32
Color 1F
CLS@ECHO Installed BLANK!
SLEEP.exe 5
EXIT
::::::::::::::::::::::::::::::::::
:FINISH64
Color 9F
CLS@ECHO Installed BLANK!
SLEEP.exe 5
EXIT
::::::::::::::::::::::::::::::::::
:FINISHXP
Color 5F
CLS@ECHO Installed BLANK!
SLEEP.exe 5
EXIT
::::::::::::::::::::::::::::::::::
-
Just another example for you.
This is another simple one, being google earth.
All I want it to do is install Google earth for any user. I’ve tested this installer and luckily it works on XP/win 7x32/64.
So first I found an installer. You can download full offline installer version 6.2 here:Then you need to unzip that exe, it will then extract the ‘real’ installer file.
Now use this script and put it in the same directory as the googleearth.exe along with sleep.exe.
You can use the script below, just copy and paste it into a .cmd file.
::::::::::::::::::::::::
@ECHO OFF
Color 1A
@ECHO Installing Google EarthSLEEP.exe 5
START /wait GoogleEarth.exe /S /v/qn /V"/qn ALLUSERS=1
SLEEP.exe 5
CLS
@ECHO Google Earth Installed…SLEEP.exe 5
EXIT
::::::::::::::::::::::::You can also hide the script if you don’t want people to be able to close it, but if you are deploying the SFX from FOG, windows 7 will actually hide the script anyway.
Now follow the earlier instructions to .7z it and make an SFX!
Thanks,
-
thanks for the share, still haven’t got around to trying snapins yet but i’m with the info above this should be quite easy to get working.
START /wait GoogleEarth.exe /S /v/qn /V"/qn ALLUSERS=1
say i wanted to deploy something else is it as simple as changing googleearth.exe to the exe that i want?
-
[quote=“falko, post: 4173, member: 48”]thanks for the share, still haven’t got around to trying snapins yet but i’m with the info above this should be quite easy to get working.
START /wait GoogleEarth.exe /S /v/qn /V"/qn ALLUSERS=1
say i wanted to deploy something else is it as simple as changing googleearth.exe to the exe that i want?[/quote]
It depends on the installer. But yes most are easy.
START /Wait means the installer will start, and the cmd script will wait for the process to finish before moving on in the script.
The /S is a switch to install it silently. /Qn will make it non interactive.
So it varies, also running .msi is a little diff, you have to have msiexec instead of “START”. Read this page for more info:
[url]http://unattended.sourceforge.net/installers.php[/url]
But you will find you don’t have to change much. See this one for FileZilla, it’s basically the same as google earth:
::::::::::::::::::::::::
@ECHO OFF
Color 4F
@ECHO Installing FileZillaSLEEP.exe 5
START /wait FileZilla3.5.3.exe /S /v/qn
SLEEP.exe 5
CLS
@ECHO FileZilla Installed…SLEEP.exe 5
EXIT
::::::::::::::::::::::::But then you might want registry entries after the install, check out the original adobe reader because that contains registry entries.
I just updated Adobe reader because for some strange reason on some machines it wouldn’t printer colour…?? Anyway check out the new adobe reader script:
::::::::::::::::::::::::
@ECHO OFF
Color 4F@ECHO DO NOT CLOSE THIS WINDOW
@ECHO Installing Adobe Reader X 3.1.2…
START /wait Reader.exe /msi EULA_ACCEPT=YES /qn
SLEEP.exe 5
::::::::::::::::::::::::
CLSREGEDIT /S Disable_protected.reg
SLEEP.exe 1
REGEDIT /S Disable_updates.reg
SLEEP.exe 1
REGEDIT /S Units_to_CM.reg
SLEEP.exe 1
REGEDIT /S EULA.reg
CLS
@ECHO INSTALLED ADOBE READER X!
SLEEP.exe 5
EXIT
::::::::::::::::::::::::
If you have any problems I’ll help if I can. A good site resource is Appdeploy.com too. Just recently got renamed to: [url]http://www.itninja.com/[/url]
-
When I follow these directions and test the snap in I get a 7-ZIP SFX archive error message. In the %temp% folder of the target host a folder called 7ZipSfx.000 is created and all the files are extracted as per above. If I click on the install.cmd within this folder adobe reader installs fine, any help is appreciated.
-
AGGGG, silly error on my part. I placed all of the files into a folder and then archived the folder. Once I put all files into the archive, not a folder before hand I deploy and it installs great!
-
[quote=“Axel, post: 4576, member: 686”]AGGGG, silly error on my part. I placed all of the files into a folder and then archived the folder. Once I put all files into the archive, not a folder before hand I deploy and it installs great![/quote]
Hi Axel glad you figured it out!
-
Thanks for sharing! The stuff with 7zip and SFX maker is definitely helpful.
Another thought to add about determining whether or not a computer is running 64 or 32bit, I’ve used these lines (in batch script):
IF %processor_architecture% == x86 (for 32 bit)
IF %processor_architecture% == AMD64 (for 64 bit clients)
IF %processor_architecture% == IA64 (for 64 bit servers)I doubt many people (if any) would ever feel the need to change the Program Files environment variable, though, so I’m sure your check works great too!
-
so, what would it be for an msi file, I made a script and used start and the msi worked fine! was I just lucky? I realized that I needed to use msiexec.exe but forgot and ran the script before hand and it worked!
would I just change start to msiexec /i -
and, what if I want to package several .msi files in to this self executable, and have this script install them one after another, will it wait for each one to finnish, or will I have to use that sleep file.
-
Hmmm… So I’ve been trying to deploy/execute vbscript using 7zip SFX – and it runs perfectly (.vbs wrapped in a .7 wrapped in a .exe, set to extract to the temp folder and execute the .vbs either directly or through a .bat file that calls cscript.exe), but after it completes, Windows always complains, saying “This program may not have installed correctly.”
Does anyone have any experience with this? So far all I’ve found is a shotgun approach of disabling the program compatibility message for [I]everything[/I] via group policy, and I’d rather not do that.
-
[S]Maybe this is a dumb question but how do you hide the script?[/S]
Nevermind. I think I figured it out!
[quote=“andyroo54, post: 4164, member: 267”]Just another example for you.
You can also hide the script if you don’t want people to be able to close it, but if you are deploying the SFX from FOG, windows 7 will actually hide the script anyway.
Thanks,[/quote] -
[SIZE=3][FONT=Times New Roman][COLOR=#000000] Snapin for Java, Adober Reader and Flash[/COLOR][/FONT][/SIZE]
[SIZE=3][COLOR=#000000][FONT=Calibri]I found this way simpler for myself so I thought I would share it the first part I got from this web site [/FONT][/COLOR][/SIZE][SIZE=3][COLOR=#000000][FONT=Calibri][url]http://d4rkcell.com/archives/929[/url] I tested it with Java 7 update 9 and it works flawlessly, also Adobe Reader XI and Flash 11.5.502.110[/FONT][/COLOR][/SIZE]
[FONT=Calibri][SIZE=3][COLOR=#000000] 1.Launch jre-****-i586.exe by double clicking it. When you see the “Welcome to Java” screen DO NOT click install. Leave the window open and open a windows explorer window.[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000] 2.Browse to C:\Users<USERNAME> where <USERNAME> is the username of the user you are logged in as. in my examples I will use C:\Users\usrsetup. The path you need to get to in this case will be C:\Users\usrsetup\AppData\LocalLow\Sun\Java.[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] 3.You should see a folder called “jre****″ basically copy this folder to your desktop. Leave the window open.[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] 4.Go back to the Java setup and close it.[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] 5.Launch jre--x64.exe and check back in C:\Users\usrsetup\AppData\LocalLow\Sun\Java[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] 6.You should see a folder called jre_x64, copy this to your desktop alongside the other folder.[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]For the next part of the process we need to download something called InstEd. This is a free MSI editing program that we will use to disable the updates in the MSI files we just got and placed on the desktop. Once you have InstEd downloaded/installed browse to C:\Users\usrsetup\Desktop\jre**** (remember the username will be different for you). Follow the below instructions.[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000] 7.Right click jre****.msi and select “InstEd It!”. This should launch the InstEd software with the java msi loaded.[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] 8.In InstEd down the left there is a pane called “Tables” scroll down this list until you see “Property” Click to highlight property. This should show some content in the main pane.[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] 9.In the main pane search for AUTOUPDATECHECK and change this from a 1 to a 0. This should stop java from auto-updating when it is installed. There also appears to be a property called JAVAUPDATE, change this from a 1 to a 0 as well just to cover all bases. Finally there is a property called JU, this needs to be changed from a 1 to a 0 as well.[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] 10.Once all properties have been changed you just simply click File > Save As and choose something like jre****_noupdate.msi. I usually save it in the folder jre****. This will leave you with two MSI files. Jre****.msi and jre****_noupdate.msi.[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] 11.Repeat this process in C:\Users\usrsetup\Desktop\jre****_x64. The filename here for the MSI file is the same as the filename for x86 so I always rename jre****.msi to jre****_x64.msi and edit this saving it as jre****_x64_noupdate.msi[/COLOR][/SIZE][/FONT]
[SIZE=3][COLOR=#000000][FONT=Calibri]12. Now start up SFXMaker 1.2 Final Click on the Directory Tab[/FONT][/COLOR][/SIZE]
[SIZE=3][COLOR=#000000][FONT=Calibri]13. Directory Path is C:\Users\usrsetup\Desktop\jre**** or jre****_64[/FONT][/COLOR][/SIZE]
[SIZE=3][COLOR=#000000][FONT=Calibri]14. File to Run is jre****_noupdate.msi or jre****_x64_noupdate.msi[/FONT][/COLOR][/SIZE]
[SIZE=3][COLOR=#000000][FONT=Calibri]15. Silent Switches is /qn[/FONT][/COLOR][/SIZE]
[FONT=Calibri][SIZE=3][COLOR=#000000]16. Select a SFX path and filename I usually use Java32 and Java64[/COLOR][/SIZE][/FONT]
[SIZE=3][COLOR=#000000][FONT=Calibri]17. check off with Progress Bar and use EXEs Icon than Click on Create.[/FONT][/COLOR][/SIZE]
[SIZE=3][COLOR=#000000][FONT=Calibri]18. With Flash (MSI files can be found here [url]http://www.adobe.com/ca/products/flashplayer/distribution3.html[/url] )the only changes to make in the MSI file if you want to stop Automatic Upadtes and agree to license are:[/FONT][/COLOR][/SIZE]
[COLOR=#000000][FONT=Symbol][SIZE=3]·[/SIZE] [/FONT][FONT=Calibri][SIZE=3]ISCHECKFORUPDATES change 1 to 0[/SIZE][/FONT][/COLOR]
[COLOR=#000000][FONT=Symbol][SIZE=3]·[/SIZE] [/FONT][FONT=Calibri][SIZE=3]AGREETOLICENSE change No to YES[/SIZE][/FONT][/COLOR]
[SIZE=3][COLOR=#000000][FONT=Calibri]19. For Adobe Reader(MSI Files can be got here [url]ftp://ftp.adobe.com/pub/adobe/reader/[/url] ) edit the MSI File if you want to Agree to License EULA Accept makes it so staff dont even notice a new install and we Disable browser intergration as it locks up on one of our programs and make the following changes:[/FONT][/COLOR][/SIZE]
[COLOR=#000000][FONT=Symbol][SIZE=3]·[/SIZE] [/FONT][FONT=Calibri][SIZE=3]AGREETOLICENSE change [/SIZE][/FONT][FONT=Calibri][SIZE=3]No to YES[/SIZE][/FONT][/COLOR]
[COLOR=#000000][FONT=Symbol][SIZE=3]·[/SIZE] [/FONT][FONT=Calibri][SIZE=3]EULA_ACCEPT change No to YES[/SIZE][/FONT][/COLOR]
[COLOR=#000000][FONT=Symbol][SIZE=3]·[/SIZE] [/FONT][FONT=Calibri][SIZE=3]DISABLE_BROWSER_INTERGRATION change No to YES[/SIZE][/FONT][/COLOR]
[SIZE=3][COLOR=#000000][FONT=Calibri]20. Use SFX maker with the switch /qn and make it an executable.[/FONT][/COLOR][/SIZE]
-
This post is deleted! -
With the way I have mine setup it installs in the background and doesn’t disturb the user while the snapin deploys the only thing the user might notice is the adobe reader shortcut showing up on there desktop. So once you have edited the msi file save it to a new name run sfx maker on it with the /qn silent swutches than create executable and upload that to the snaping folder. add snaping to whatever computer you want than deploy either all snapins or a single snapin under the advanced tasks.
-
[quote=“Darrell Lanson, post: 9630, member: 1392”]With the way I have mine setup it installs in the background and doesn’t disturb the user while the snapin deploys the only thing the user might notice is the adobe reader shortcut showing up on there desktop. So once you have edited the msi file save it to a new name run sfx maker on it with the /qn silent swutches than create executable and upload that to the snaping folder. add snaping to whatever computer you want than deploy either all snapins or a single snapin under the advanced tasks.[/quote]
Ours used to be done like this, but I found that fog actually hides it anyway if you deploy it from Fog.But I prefer to see it run if I’m running the SFX “manually”.
-
I’m looking for some better understanding on this:
Can the snap-in tool run any executable? (Meaning could I simply write my executable in AutoIT, and then compile to exe?)
Also what user does the file run as? Currently logged on user? System account?
If I disable the UAC controls, will that stay disabled when the system joins a domain?
How many times does the Snapin attempt to run? -
[quote=“Selfcommit, post: 10436, member: 801”]I’m looking for some better understanding on this:
Can the snap-in tool run any executable? (Meaning could I simply write my executable in AutoIT, and then compile to exe?)
Also what user does the file run as? Currently logged on user? System account?
If I disable the UAC controls, will that stay disabled when the system joins a domain?
How many times does the Snapin attempt to run?[/quote]Yes it can run anything. Just remember, the sfx is just a 7zip compressed archive.
The 7zip file is made into an exe by the sfx program. All the exe does is extract the zip archive to a temporary location, then runs whatever command you specify.
In my example, the sfx will extract the installer and the .cmd script to a temp location, then it runs the .cmd file, which then launches the installer silently. In theory, you could just tell the sfx maker to run the adobe installer, but it would not complete without input from the user which is why we use a cmd script to automate it.
In your case, you could tell sfx maker to execute your executable that you made in AutoIT. I’d suggest trying to make a few SFX first to learn more about it.
-
So does the fog client look specifically for an sfx, or does it just run whatever executable it’s handed as a snapin?
Also - Does it run as the currently logged on user, or as a system account?
When does it run? At logon?
-
[quote=“Selfcommit, post: 10446, member: 801”]So does the fog client look specifically for an sfx, or does it just run whatever executable it’s handed as a snapin?
Also - Does it run as the currently logged on user, or as a system account?
When does it run? At logon?[/quote]
I imagine it will run any exe. I haven’t tried, but I don’t know how it would distinguish one .exe from the other, so again it should work. You will just have to try it.
If deployed from fog it will run as the administrator account you setup for fog. If you run it manually on the PC it will run with whatever privileges you have, ie it will not work if standard user, need to run as administrator.