Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Need help with Add-On Maker (or making an Addon)

- - - - -

  • Please log in to reply
6 replies to this topic

#1
NOTS3W

NOTS3W

    Member

  • Member
  • PipPip
  • 117 posts
  • Joined 19-April 07
I hate not being able to figure this out, but I'm not seeing the problem.

I'm trying to create an addon for Microsoft Security Essentials but I need to set one registry value before the install. I need to put RealVNC on a white list so MSE doesn't report it as a problem. This batch file (Installer.cmd) works from a command line after Windows is installed if I place it and mseinstall.exe on the root of C: so it's in Windows' default path:

REG ADD "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Paths" /v "%PROGRAMFILES%\RealVNC\VNC4\*.*" /t REG_DWORD /d 0 /f

mseinstall /s /runwgacheck

When I use nLite Add-On Maker, I place my .cmd file and the mseinstall.exe file in a folder, point Add-On Maker to that folder and choose Installer.cmd as the installation file. Then I make an Add-On .cab file and it contains both Install.cmd and mseinstall.exe in the svcpack subfolder so it looks like everything is where it's supposed to be, When I include my addon in nLite's Addon section and build a new ISO, I get the following message duirng the "registers components" phase of Windows' installation:

Error during execution "batchrunner Installer.cmd hidcon".
The system cannot find the file specified.


Does that mean Windows cannot find Installer.cmd or it cannot find mseinstall.exe that's in the .cab and called by Installer.cmd?

I'm not sure where to begin to troubleshoot this since it looks like I did everything correctly. Can someone point me to where I'm going wrong or how to test this further? Is there maybe a better way to build an addon with both a registry tweak and an installer without getting too complicated?

TIA. I appreciate it.


How to remove advertisement from MSFN

#2
Geej

Geej

    Senior Member

  • Member
  • PipPipPipPip
  • 635 posts
  • Joined 01-January 08
  • OS:XP Pro x86
  • Country: Country Flag

Is there maybe a better way to build an addon with both a registry tweak and an installer without getting too complicated?

TIA. I appreciate it.

Well, since nobody response to your post, I'm attempting to provide you 2 possible solutions I think might work.
Since I am not familiar with nLite Add-On Maker (never heard of it), I provide you with 7z sfx tool config file syntax
;!@Install@!UTF-8!
GUIMode="2"
RunProgram="hidcon:cmd /c Reg add \"HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Paths\" /v \"%PROGRAMFILES%\RealVNC\VNC4\*.*\" /t REG_SZ /d \"0\" /f"
RunProgram="mseinstall /s /runwgacheck"
;!@InstallEnd@!
Will run silently except during extraction of mseinstall.exe (when you packed into exe, no need to put in any batch file, just mseinstall.exe will do.

2nd alternative is winrar. Use this config syntax.
;The comment below contains SFX script commands

Setup=ExcludeRealVNC.cmd
Setup=mseinstall /s /runwgacheck
TempMode
Silent=1
Overwrite=1
Your newly packed installer should have the batch file name ExcludeRealVNC.cmd and mseinstall.exe
A short moment of cmd window will open onscreen when ExcludeRealVNC,cmd is ran.

Hope that helps a bit...

Edited by Geej, 30 May 2011 - 11:12 PM.


#3
ricktendo

ricktendo

    Group: Banned Members

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,310 posts
  • Joined 06-June 06
  • OS:Windows 7 x64
  • Country: Country Flag
Add /o so the program does not launch

#4
NOTS3W

NOTS3W

    Member

  • Member
  • PipPip
  • 117 posts
  • Joined 19-April 07
Thanks Geej!

Since my original post, I've been doing more research and experimenting. I found ricktendo64's tutorial on switchless installers and created one for Security Essentials with the registry tweak I needed. It works perfectly from the desktop after Windows is installed but Add-On Maker turned the 7MB installer into a 516MB addon which still didn't work. I was finally able to get it to run properly by placing the switchless installer in my own GuiRunOnce.cmd (where I clean up some shortcuts and folders). I'd still prefer this be an addon like the other applications I'm installing so I'll try the 7-zip method this evening.

Ricktendo64,

Thanks for that switchless installer tutorial. I'm not sure about all of what's going on there, but the result is a working installer so I'm happy. I didn't know about the /o switch but I'm not sure I need it. When it installs during RunOnce after first logon, it doesn't matter that it launches and updates itself. If I'm successful in creating an addon, at what time will it get installed? Maybe I will need to stop the update if the install happens before the last reboot.

#5
NOTS3W

NOTS3W

    Member

  • Member
  • PipPip
  • 117 posts
  • Joined 19-April 07
Help me understand how this works. If I have a switchless installer, can I simply put that into the svcpack subfolder of an addon folder, create a .ini file in the addon folder referencing the switchless installer and using regular 7-zip, create an addon of everything in the addon folder? I think that's what I'm finding and I would simply call the switchless installer from the [AddPrograms] section of the .ini file without any additional switches. I like having a switchless installer that I can test by running on a working installation without having to pack it into a new installation to see if it works okay. Once that's good, I can put it into an addon. Am I missing something with that logic?

Do addons and switchless installers both execute after first logon?

To continue that line of thinking, can I have multiple entries in [AddPrograms] (it is plural after all)? Can I put both lines from my switchless installer into the [AddPrograms] section and not have to create a switchless installer?

Using my Security Essentials installation as an example, I've created a switchless installer using Ricktendo's method. It uses a config.txt file as you've shown above then this Create.cmd:

upx --ultra-brute 7zsd.sfx  
cd Bin 
..\7za a -mx=9 "..\Program.7z" *  
cd .. 
copy /b 7zsd.sfx + Config.txt + Program.7z MS_Security_Essentials_2.0.657.0_Switchless.exe
del Program.7z

Which creates my switchless installer:

MS_Security_Essentials_2.0.657.0_Switchless.exe

My understanding is that I can put that switchless installer in a svcpack folder and create an ENTRIES_MS_Security_Essentials_2.0.657.0_Switchless.ini file at the same level as the svcpack folder:

[general]
builddate=06/01/2011
description=MS Security Essentials 2.0.657.0 Addon
title=MS Security Essentials 2.0.657.0 Addon
version=2.0.657.0
website=

[EditFile]
I386\SVCPACK.INF,SetupHotfixesToRun,AddProgram

[AddProgram]
MS_Security_Essentials_2.0.657.0_Switchless.exe

Then can I just zip the ini file and the svcpack folder into a new Addon_MS_Security_Essentials_2.0.657.0.7z using regular 7zip or do I need to use a special version of 7zip? Can I change the extension to .cab or is a .cab file different than a .7z file?

Can I skip the switchless installer, put the original mseinstall.exe in svcpack, and create a different version of ENTRIES_MS_Security_Essentials_2.0.657.0_Switchless.ini using the two RunProgram entries from the switchless installer process?

[general]
builddate=06/01/2011
description=MS Security Essentials 2.0.657.0 Addon
title=MS Security Essentials 2.0.657.0 Addon
version=2.0.657.0
website=

[EditFile]
I386\SVCPACK.INF,SetupHotfixesToRun,AddProgram

[AddProgram]
hidcon:cmd /c Reg add \"HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Paths\" /v \"%PROGRAMFILES%\RealVNC\VNC4\*.*\" /t REG_SZ /d \"0\" /f
mseinstall /o /s /runwgacheck

Then 7zip everything into Addon_MS_Security_Essentials_2.0.657.0.7z? (or ...cab?) Do the same rules for double quotes and backslashes apply?

Is that equivelent to creating a switchless installer THEN an addon? In that case, one could avoid the special versions of 7zip (7zsd and 7za) and all the other dedicated programs used to make these packages.

I'll try it but the only way I know of to test an addon is to insert it into an nlite build and install Windows. An hour later, I know if it worked or if I need to try again. If I've over simplified this or if you know of changes I need to make, save me some time by letting me know, please.

It seems like I tried something like this before by putting a .reg file in the svcpack folder and calling REGEDIT ... from the ini file, but it didn't work. Maybe I didn't have the right path to REGEDIT at the time.

I appreciate your input. I'm sorry for the lengthy questions, but I'm really trying to learn this.

#6
ricktendo

ricktendo

    Group: Banned Members

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,310 posts
  • Joined 06-June 06
  • OS:Windows 7 x64
  • Country: Country Flag
Remove hidcon: from the entries.ini file, this is only for config.txt or 7zip sfx (its a command to hide the cmd console window) and yes you can skip the sfx and use the original installer with switches

BTW if you use nLite you can use the [registry_addreg] section to add that registry entry

[general]
builddate=06/01/2011
description=MS Security Essentials 2.0.657.0 Addon
title=MS Security Essentials 2.0.657.0 Addon
version=2.0.657.0
website=

[EditFile]
I386\SVCPACK.INF,SetupHotfixesToRun,AddProgram

[AddProgram]
mseinstall /s /runwgacheck /o

; nLite only
[registry_addreg]
HKLM,"SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Paths","%16422%\RealVNC\VNC4\*.*",,"0"

If you dont use nLite here is your reg.exe cmdline corrected
[AddProgram]
reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Paths" /v "%PROGRAMFILES%\RealVNC\VNC4\*.*" /t REG_SZ /d "0" /f
mseinstall /s /runwgacheck /o

Edited by ricktendo64, 01 June 2011 - 09:55 AM.


#7
NOTS3W

NOTS3W

    Member

  • Member
  • PipPip
  • 117 posts
  • Joined 19-April 07
I think I've finally gotten this to work consistently. Thank you both for your education and help. I've saved detailed notes in a text file for the next time I try to do this. :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users