Updated associations for Windows 8 and removed 32/64 bit script difference

This commit is contained in:
Peter Singer 2013-05-07 15:08:03 +02:00
parent 05aa7c4ed7
commit 5b2266f1f0
3 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<DefaultAssociations>
<Association Identifier="http" ProgId="FirefoxURL" ApplicationName="Firefox" />
<Association Identifier="https" ProgId="FirefoxURL" ApplicationName="Firefox" />
</DefaultAssociations>

View File

@ -19,6 +19,9 @@ DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
; DefVar $InstallDir$
DefVar $ProgExe$
Set $LogDir$ = "%SystemDrive%\tmp"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
@ -64,6 +67,11 @@ else
Winbatch_install
Sub_check_exitcode
comment create associations
; Set $InstallDir$ = $InstallDir32$
Set $ProgExe$ = $Prog32$
DosInAnIcon_install winst /Sysnative
comment "Copy files"
Files_install /32Bit
@ -75,6 +83,42 @@ else
endif
[DosInAnIcon_install]
@echo off
If exist "%System%\defaultassociations.xml" (copy "%System%\defaultassociations.xml" "$LogDir$") ELSE (copy "%ScriptPath%\defaultassociations.xml" "$LogDir$")
rem Handling for X86 installation directory since Windows Vista
SET InstallDir=$InstallDir$
for /f "tokens=1-3 delims=\" %%a in ("$InstallDir$") do (
set a=%%a
set b=%%b
set c=%%c
)
IF "%b%" == "Program Files (x86)" SET InstallDir=%a%^\Program Files ^^(x86^^)^\%c%
SET Prog=$ProgExe$
SET Prog=%Prog:~0,-4%
SET SC=HKLM\Software\Classes
SET Extn=http-1 https-1 ftp-1
FOR %%j IN (%Extn%) DO (
FOR /F "tokens=1,2 delims=-" %%A IN ("%%j") DO (
REG ADD %SC%\%%A /VE /D "Firefox-%%A" /F
REG ADD %SC%\Firefox-%%A /VE /D "%%A Firefox" /F
REG ADD %SC%\Firefox-%%A\DefaultIcon /VE /D "$InstallDir$\%Prog%.exe,%%B" /F
REG ADD %SC%\Firefox-%%A\shell\open\command /VE /D "\"%InstallDir%\%Prog%.exe\" -osint -url \"%%1\"" /F
copy "$LogDir$\defaultassociations.xml" "$LogDir$\defaultassociations.xml.old"
xml ed -d /DefaultAssociations/Association[@Identifier='%%A'] "$LogDir$\defaultassociations.xml.old"> "$LogDir$\defaultassociations.xml"
copy "$LogDir$\defaultassociations.xml" "$LogDir$\defaultassociations.xml.old"
xml ed -s /DefaultAssociations -t elem -n Association_new -v "" -i /DefaultAssociations/Association_new -t attr -n Identifier -v %%A -i /DefaultAssociations/Association_new -t attr -n ProgId -v Firefox-%%A -i /DefaultAssociations/Association_new -t attr -n ApplicationName -v "Mozilla Firefox" -r "/DefaultAssociations/Association_new" -v Association "$LogDir$\defaultassociations.xml.old"> "$LogDir$\defaultassociations.xml"
)
)
rem Set Default Associations for Windows 8
move "$LogDir$\defaultassociations.xml" "%System%"
REG ADD HKLM\Software\Policies\Microsoft\Windows\System /V DefaultAssociationsConfiguration /D "%System%\defaultassociations.xml" /F
[Winbatch_install]
REG ADD HKLM\SOFTWARE\Mozilla\MaintenanceService /v Attempted /t REG_DWORD /d 1 /f
"$InstallExe$" -ms

View File

@ -29,3 +29,11 @@ ICON_DL_INDEX=0
OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="UninstallProg"
OPSI_INI_VALUE[0]="uninstall\helper.exe"
OPSI_INI_SECTION[1]="X86"
OPSI_INI_OPTION[1]="Prog32"
OPSI_INI_VALUE[1]="firefox.exe"
OPSI_INI_SECTION[2]="X86_64"
OPSI_INI_OPTION[2]="Prog64"
OPSI_INI_VALUE[2]="firefox.exe"