Jump to content
DeployCentral

Passing parameters between PreImage & PostImage scripts


Recommended Posts

Hello!

I need a consistent way to pass information between the PreImage and the PostImage scripts.

I'm deploying the corporate computers using an offline USB drive. In order to avoid modifications, I'm adding a md5 checksum on the PreImage task in order to detect if my configuration file has been tampered with or modified. If the verification fails, It shows an error message and forces a shutdown. But if the verification is successful, I need a way to tell that to the PostImage script. Normally I would do that using an environment variable, but the command window closes after PreImage script finishes (hence I lose all environment vars I may have been set for that session) and the 'setx' command is not available in Windows PE. I've been thinking in either writing a temporary file (which I don't like) or maybe setting a temporary registry key in Windows PE.

So, my question is: is there a recommended way to pass information between the PreImage and the PostImage scripts? Maybe is there some undocumented 'setx' equivalent tool available somewhere in the SmartDeploy Windows PE environment?

Thanks in advance and best regards,

-- Javier Llorente

Link to comment
Share on other sites

Hi Javier,

Unfortunately, this is not a supported feature. Command-line Tasks are available in WindowsPE, but they are subject to the inherent limitations of the environment. You mentioned writing to a file as a possibility - this could be a viable workaround.

SmartDeploy Support Team

 

TECH RESOURCES

SmartDeploy User Guides

DeployCentral Forum

Platform Pack RSS

 

SOCIAL

SpiceworksTwitterfacebookyoutube

Link to comment
Share on other sites

Hi Support,

I've finally opted for the registry key option: I write a specific value inside "HKEY_CURRENT_USER\Environment" in the PreImage script and later I check that registry key in the PostImage script. I've done a proof of concept and it works fine.

Thanks for the prompt answer and best regards,

-- Javier Llorente

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...