Giter VIP home page Giter VIP logo

adobe-air-registry-modifier's Introduction

Adobe Air Registry Modifier

This project intended to provide an integration between Adobe Air projects and Windows Registry by which it is possible to modify Windows Registry in Adobe Air projects. Since Adobe Air is a cross-platform SDK, there is no built-in class to modify Windows Registry. However, it could be done using NativeProcess class and an interface tool between Adobe Air and Windows Registry such as Python.

Installation

  1. Install Python 2.7.x
  2. Download py2exe and install it.
  3. In order to make a standalone process.exe file which is used as NativeProcess executer, open Command Prompt:
  • cd src-python
  • c:\PATH_TO_PYTHON\python.exe setup.py
  1. Then, process.exe would be found in dist folder. Copy only process.exe file to your Adobe Air project (you don't need to include .py files in your Adobe Air project).

Note: In Adobe Air manifest file, use <supportedProfiles>extendedDesktop desktop</supportedProfiles> to be allowed to use NativeProcess.

How to use

  • Instantiate RegistryModify class:
import org.appsroid.RegistryModify;

RegistryModify rm = new RegistryModify("RELATIVE/PATH/TO/process.exe");
rm.addEventListener("ErrorData", onError);

// onError Listener
function onError(e:Event):void {
    trace("Error message:", rm._output);
}

// Read the value of a Key
rm.readValue("Root Key", "path\\to\\parent", "key_name");
rm.addEventListener("OutputData", onReadValue);

function onReadValue(e:Event):void {
    rm.removeEventListener("OutputData", onReadValue);
    trace("Value:", rm._output);
}

// Write a value to a Key
rm.writeValue("Root Key", "path\\to\\parent", "key_name", "value");
rm.addEventListener("OutputData", onWriteComplete);

function onWriteComplete(e:Event):void {
    rm.removeEventListener("OutputData", onWriteComplete);
    trace("Value was written.");
}

// Write a dword value to a Key
rm.writeDwordValue("Root Key", "path\\to\\parent", "key_name", "value");
rm.addEventListener("OutputData", onWriteDwordComplete);

function onWriteDwordComplete(e:Event):void {
    rm.removeEventListener("OutputData", onWriteDwordComplete);
    trace("Value was written.");
}

// Delete a Key
rm.deleteKey("Root Key", "path\\to\\key");
rm.addEventListener("OutputData", onDeleteComplete);

function onDeleteComplete(e:Event):void {
    rm.removeEventListener("OutputData", onDeleteComplete);
    trace("Key was deleted.");
}

// Check if a Key exists
rm.checkKey("Root Key", "path\\to\\key");
rm.addEventListener("OutputData", onCheckComplete);

function onCheckComplete(e:Event):void {
    rm.removeEventListener("OutputData", onCheckComplete);
    if (rm._output == "exists") {
        trace("We found the key!");
    } else {
        trace("Key not found.");
    }
}
  • Root Keys (as _rootkey parameter): HKEY_LOCAL_MACHINE, HKEY_CLASSES_ROOT, HKEY_CURRENT_CONFIG, HKEY_CURRENT_USER and HKEY_USERS
  • Example of _path parameter: Software\\Microsoft\\Office\\11.0\\Common\\General Don't use / rather than \\
  • Example of _key parameter: RecentFiles

adobe-air-registry-modifier's People

Contributors

yaa110 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.