Welcome to MSFN

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.


illusions

Registry setting not imported

4 posts in this topic

Hi, I am using windows 7 64bit

case 1

I applied "disable Open File Security Warning.reg", reboot the computer, and I will not get Open File Security Warning.

==========================================================

Windows Registry Editor Version 5.00

; Created by: Shawn Brink

; http://www.sevenforums.com

; Tutorial: Open File Security Warning - Enable or Disable

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments]

"SaveZoneInformation"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations]

"LowRiskFileTypes"=".avi;.bat;.com;.cmd;.exe;.htm;.html;.lnk;.mpg;.mpeg;.mov;.mp3;.msi;.m3u;.rar;.re g;.txt;.vbs;.wav;.zip;"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments]

"SaveZoneInformation"=-

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Associations]

"LowRiskFileTypes"=-

==========================================================

case 2

But using WPI (windows post installation wizard ) to install the game and apply the registry, I still get this nag message refer to the picture.

WPI code

{REGEDIT} "%wpipath%\\disable Program Compatibility Assistant.reg"

{REBOOT 3}

I know I can always uncheck the box "Always ask before opening this file". But I want to create an auto installer of the game with all the configurations.

please advice and thanks.

post-31401-0-40084400-1371488689_thumb.j

0

Share this post


Link to post
Share on other sites

A workaround, if we want integrate this registry keys is to use RunOnceEx method, like this example:

1 - Create a batch file:

Assistant.bat


@echo off

REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnceEx
SET KEY=HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY%\010 /V 1 /D "REGEDIT /S %systemroot%\Setup\scripts\Assistant.reg" /f

shutdown.exe /r /t 10
EXIT

2 - Inside your %Distribution_Folder%, create $OEM$\$$\Setup\scripts (inside :.\sources)

3 - Copy your Registry file inside the folder scripts:

Assistant.reg (added more values)


Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; http://www.sevenforums.com
; Tutorial: Open File Security Warning - Enable or Disable

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments]
"SaveZoneInformation"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations]
"LowRiskFileTypes"=".avi;.bat;.com;.cmd;.exe;.htm;.html;.lnk;.mpg;.mpeg;.mov;.mp3;.msi;.m3u;.rar;.reg;.txt;.vbs;.wav;.zip"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Download]
"CheckExeSignatures"="no"
"RunInvalidSignatures"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments]
"SaveZoneInformation"=-

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Associations]
"LowRiskFileTypes"=-

4 - Using Execute after with WPI inside Options wizard Tools (checked)

5a - You can use and write: {BATCH}

5b - And browse to the path where you set the batch file:

example: {BATCH} C:\WPI_v8.6.6\Install\Tweaks\Assistant.bat

WPI_Log.txt

lundi 17 juin 2013 21:18:47

Programme: Execute After

ID unique: EXECUTE_AFTER

Ordre: 0

Catégorie: WPI Built In

lundi 17 juin 2013 21:18:47 - cmd1 Succès (Code de retour 0): "cmd.exe" /C "C:\WPI_v8.6.6\Install\Tweaks\Assistant.bat"

lundi 17 juin 2013 21:18:48 - Installation terminée.

6 - The registry file will take effect when the computer restarts

Tested and works fine!

*Edit: Check if you have unlocked the exe file first

Edited by myselfidem
0

Share this post


Link to post
Share on other sites

*Edit: Check if you have unlocked the exe file first

Thanks for the code and you are absolutely right, I did not unlock the exe file.

I never encounter such situation of a file being locked.

Thank you once again . :thumbup

Edited by illusions
0

Share this post


Link to post
Share on other sites

NOTE:

However if you use WPI on your computer and exit without using a new time 'Execute after'

the settings about the registry keys will be erased and saved as default with security values!


; Key removed
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations]
"LowRiskFileTypes"=".avi;.bat;.com;.cmd;.exe;.htm;.html;.lnk;.mpg;.mpeg;.mov;.mp3;.msi;.m3u;.rar;.reg;.txt;.vbs;.wav;.zip"


; Key restored with default value
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Download]
"RunInvalidSignatures"=dword:00000000

Regards

*Edit: We can see how works inside WPI:

Inside WPI.hta


WriteRegKey("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Download\\CheckExeSignatures","no","REG_SZ");
WriteRegKey("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Download\\RunInvalidSignatures",1,"REG_DWORD");
WriteRegKey("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Associations\\LowRiskFileTypes",".js;.zip;.rar;.nfo;.txt;.exe;.bat;.com;.cmd;.reg;.msi;.hta;.htm;.html;.gif;.bmp;.jpg;.avi;.mpg;.mpeg;.mov;.mp3;.m3u;.wav;.ade;.adp;.bas;.chm;.cpl;.crt;.dll;.hlp;.inf;.ins;.isp;.jse;.lnk;.mdb;.mde;.msc;.msp;.mst;.pcd;.pif;.scr;.sct;.shs;.url;.vb;.vbe;.vbs;.wsc;.wsf;.wsh","REG_SZ");

And inside core.js

On line 543:

WriteRegKey("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Download\\RunInvalidSignatures",0,"REG_DWORD");

And from line 593:


if (!ExitBeforeInstall)
{
RestoreRegistryKeys();

if (getOSver()=="XP" || getOSver()=="Vista" || getOSver()=="Win7" || getOSver()=="Win8")
{
DeleteRegKey("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Associations\\LowRiskFileTypes");
DeleteRegKey("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Associations\\");
}

Edited by myselfidem
0

Share this post


Link to post
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.